40 #ifndef _uilinelist_cpp
41 #define _uilinelist_cpp
43 #include "UI/linelist.h"
44 #include "UI/uienumerations.h"
45 #include "UI/uimanager.h"
46 #include "UI/screen.h"
47 #include "UI/simplerenderer.h"
63 if(!this->Parent->IsVisible())
70 const ColourValue& Colour = this->Parent->GetLineColour();
71 const Real& Thickness = this->Parent->GetLineThickness();
72 bool IsClosed = this->Parent->IsClosed();
74 if(Positions.size() < 2)
78 Real HalfThickness = Thickness * 0.5;
79 Vector2 PerpNorm, LastLeft, LastRight, ThisLeft, ThisRight, UV = this->Parent->GetScreen()->GetWhitePixel(PriAtlas);
81 for( ; Index < Positions.size() ; Index++ )
83 PerpNorm = (Positions[Index] - Positions[Index - 1]).Perpendicular().
Normalize();
84 LastLeft = Positions[Index -1 ] - PerpNorm * HalfThickness;
85 LastRight = Positions[Index -1 ] + PerpNorm * HalfThickness;
86 ThisLeft = Positions[Index] - PerpNorm * HalfThickness;
87 ThisRight = Positions[Index] + PerpNorm * HalfThickness;
90 this->PushVertex(LastRight.
X,LastRight.
Y,UV,Colour,PriAtlas);
91 this->PushVertex(ThisLeft.
X,ThisLeft.
Y,UV,Colour,PriAtlas);
92 this->PushVertex(LastLeft.
X,LastLeft.
Y,UV,Colour,PriAtlas);
94 this->PushVertex(LastRight.
X,LastRight.
Y,UV,Colour,PriAtlas);
95 this->PushVertex(ThisRight.
X,ThisRight.
Y,UV,Colour,PriAtlas);
96 this->PushVertex(ThisLeft.
X,ThisLeft.
Y,UV,Colour,PriAtlas);
101 Index = Positions.size() - 1;
102 PerpNorm = (Positions[0] - Positions[Index]).Perpendicular().
Normalize();
103 LastLeft = Positions[Index] - PerpNorm * HalfThickness;
104 LastRight = Positions[Index] + PerpNorm * HalfThickness;
105 ThisLeft = Positions[0] - PerpNorm * HalfThickness;
106 ThisRight = Positions[0] + PerpNorm * HalfThickness;
109 this->PushVertex(LastRight.
X,LastRight.
Y,UV,Colour,PriAtlas);
110 this->PushVertex(ThisLeft.
X,ThisLeft.
Y,UV,Colour,PriAtlas);
111 this->PushVertex(LastLeft.
X,LastLeft.
Y,UV,Colour,PriAtlas);
113 this->PushVertex(LastRight.
X,LastRight.
Y,UV,Colour,PriAtlas);
114 this->PushVertex(ThisRight.
X,ThisRight.
Y,UV,Colour,PriAtlas);
115 this->PushVertex(ThisLeft.
X,ThisLeft.
Y,UV,Colour,PriAtlas);
130 this->Parent->_MarkDirty();
143 Priority(UI::RP_Medium)
158 this->
Colour = LineColour;
198 return Renderable::RT_LineList;