44 #include "exception.h"
67 return (Value >= Min) && (Value <= Max);
84 this->Position.SetValues(PosX,PosY);
85 this->Size.SetValues(SizeX,SizeY);
86 this->Relative =
false;
95 this->Position.SetValues(PosX,PosY);
96 this->Size.SetValues(SizeX,SizeY);
97 this->Relative = Relative;
105 this->Position = Position;
107 this->Relative =
false;
116 this->Position = Position;
118 this->Relative = Relative;
125 this->Size = Other.
Size;
133 this->Relative =
false;
144 this->Position.SetIdentity();
145 this->Size.SetIdentity();
151 return Vector2(Position.X + (Size.X * 0.5),Position.Y + (Size.Y * 0.5));
158 bool XOverlap = ValueInRange(this->Position.X, OtherRect.
Position.
X, OtherRect.
Position.
X + OtherRect.
Size.
X) ||
159 ValueInRange(OtherRect.
Position.
X, this->Position.X, this->Position.X + this->Size.X);
161 bool YOverlap = ValueInRange(this->Position.Y, OtherRect.
Position.
Y, OtherRect.
Position.
Y + OtherRect.
Size.
Y) ||
162 ValueInRange(OtherRect.
Position.
Y, this->Position.Y, this->Position.Y + this->Size.Y);
164 return (XOverlap && YOverlap);
171 return ( ValueInRange(Point.
X,this->Position.X,this->Position.X + this->Size.X) &&
172 ValueInRange(Point.
Y,this->Position.Y,this->Position.Y + this->Size.Y) );
179 return ValueInRange(Position,this->Position.X,this->Position.X + this->Size.X);
186 return ValueInRange(Position,this->Position.Y,this->Position.Y + this->Size.Y);
198 Vector2 PrevCenter = this->GetRectCenter();
199 this->Size *= Scaling;
201 this->Position.
X = PrevCenter.
X - ( this->Size.X * 0.5 );
202 this->Position.Y = PrevCenter.
Y - ( this->Size.Y * 0.5 );
216 this->Size = Other.
Size;
225 return ( this->Position == Other.
Position && this->Size == Other.
Size && this->Relative == Other.
Relative );
232 return ( this->Position != Other.
Position || this->Size != Other.
Size || this->Relative != Other.
Relative );
262 if( !RectNode.
Empty() ) {
265 if( !CurrAttrib.
Empty() )
266 this->Position.X = CurrAttrib.
AsReal();
269 if( !CurrAttrib.
Empty() )
270 this->Position.Y = CurrAttrib.
AsReal();
273 if( !CurrAttrib.
Empty() )
274 this->Size.X = CurrAttrib.
AsReal();
277 if( !CurrAttrib.
Empty() )
278 this->Size.X = CurrAttrib.
AsReal();