This class represents a box shaped area on the screen.
More...
#include <rect.h>
|
| Rect (const Real &PosX, const Real &PosY, const Real &SizeX, const Real &SizeY) |
| Less Detailed Real Constructor. More...
|
|
| Rect (const Real &PosX, const Real &PosY, const Real &SizeX, const Real &SizeY, bool Relative) |
| Real Constructor. More...
|
|
| Rect (const Vector2 &Position, const Vector2 &Size) |
| Less Detailed Vector2 Constructor. More...
|
|
| Rect (const Vector2 &Position, const Vector2 &Size, bool Relative) |
| Vector2 Constructor. More...
|
|
| Rect (const Rect &Other) |
| Copy Constructor. More...
|
|
| Rect () |
| No Initialization Constructor. More...
|
|
| ~Rect () |
| Class destructor.
|
|
Rect & | ApplyScaling (const Vector2 &Scaling) |
| Scales this rect. More...
|
|
bool | CheckOverlap (const Rect &OtherRect) const |
| Checks to see if another Rect is overlapping with this one. More...
|
|
Vector2 | GetRectCenter () const |
| Gets the coordinates to the center of this rect. More...
|
|
bool | IsInside (const Vector2 &Point) const |
| Checks to see if a point in 2D space is inside this rect. More...
|
|
bool | IsWithinHeight (const Real &Position) const |
| Gets whether or point on the Y axis is within the limits of this rect or not. More...
|
|
bool | IsWithinWidth (const Real &Position) const |
| Gets whether or point on the X axis is within the limits of this rect or not. More...
|
|
bool | operator!= (const Rect &Other) |
| Inequality Comparison Operator. More...
|
|
Rect & | operator= (const Rect &Other) |
| Assignment Operator. More...
|
|
bool | operator== (const Rect &Other) |
| Equality Comparison Operator. More...
|
|
void | ProtoDeSerialize (const XML::Node &SelfRoot) |
| Take the data stored in an XML Node and overwrite this object with it. More...
|
|
void | ProtoSerialize (XML::Node &ParentNode) const |
| Convert this class to an XML::Node ready for serialization. More...
|
|
void | SetIdentity () |
| Sets all the values of this rect to zero.
|
|
|
Vector2 | Position |
| Vector2 representing the top-left position of the rect.
|
|
bool | Relative |
| Bool representing whether this rect is represented in relative units or absolute units(pixels).
|
|
Vector2 | Size |
| Vector2 representing the width and height of the rect.
|
|
This class represents a box shaped area on the screen.
Definition at line 57 of file rect.h.
Mezzanine::UI::Rect::Rect |
( |
const Real & |
PosX, |
|
|
const Real & |
PosY, |
|
|
const Real & |
SizeX, |
|
|
const Real & |
SizeY |
|
) |
| |
|
inline |
Less Detailed Real Constructor.
- Parameters
-
PosX | The position of this rect on the X axis. |
PosY | The position of this rect on the Y axis. |
SizeX | The size of this rect on the X axis. |
SizeY | The size of this rect on the Y axis. |
Definition at line 82 of file rect.h.
Mezzanine::UI::Rect::Rect |
( |
const Real & |
PosX, |
|
|
const Real & |
PosY, |
|
|
const Real & |
SizeX, |
|
|
const Real & |
SizeY, |
|
|
bool |
Relative |
|
) |
| |
|
inline |
Real Constructor.
- Parameters
-
PosX | The position of this rect on the X axis. |
PosY | The position of this rect on the Y axis. |
SizeX | The size of this rect on the X axis. |
SizeY | The size of this rect on the Y axis. |
Definition at line 93 of file rect.h.
Mezzanine::UI::Rect::Rect |
( |
const Vector2 & |
Position, |
|
|
const Vector2 & |
Size |
|
) |
| |
|
inline |
Less Detailed Vector2 Constructor.
Sets all the data of the class.
- Parameters
-
Definition at line 103 of file rect.h.
Mezzanine::UI::Rect::Rect |
( |
const Vector2 & |
Position, |
|
|
const Vector2 & |
Size, |
|
|
bool |
Relative |
|
) |
| |
|
inline |
Vector2 Constructor.
Sets all the data of the class.
- Parameters
-
Position | The position of the Renderable's Rect. |
Size | The size of the Renderable's Rect. |
Relative | Whether or not this Rect is using relative(0-1) or absolute units(Pixels). |
Definition at line 114 of file rect.h.
Mezzanine::UI::Rect::Rect |
( |
const Rect & |
Other) | |
|
|
inline |
Copy Constructor.
- Parameters
-
Other | The other Rect to copy. |
Definition at line 122 of file rect.h.
Mezzanine::UI::Rect::Rect |
( |
) | |
|
|
inline |
No Initialization Constructor.
Sets all data members to zero's.
Definition at line 130 of file rect.h.
Rect& Mezzanine::UI::Rect::ApplyScaling |
( |
const Vector2 & |
Scaling) | |
|
|
inline |
Scales this rect.
- Note
- This will scale the rect based on it's center, not it's top-left position. If you want to instead preserve the position of the Rect then apply the scaling manually.
- Parameters
-
Scaling | A Vector2 representing the X and Y scaling to be applied to this rect. |
- Returns
- Returns a reference to this.
Definition at line 196 of file rect.h.
bool Mezzanine::UI::Rect::CheckOverlap |
( |
const Rect & |
OtherRect) | |
const |
|
inline |
Checks to see if another Rect is overlapping with this one.
- Parameters
-
OtherRect | The other rect to compare against. |
- Returns
- Returns true if these rects overlap with each other, false otherwise.
Definition at line 156 of file rect.h.
Vector2 Mezzanine::UI::Rect::GetRectCenter |
( |
) | |
const |
|
inline |
Gets the coordinates to the center of this rect.
- Returns
- Returns a vector2 containing the central point of this rect.
Definition at line 149 of file rect.h.
static String Mezzanine::UI::Rect::GetSerializableName |
( |
) | |
|
|
inlinestatic |
Get the name of the the XML tag the Renderable class will leave behind as its instances are serialized.
- Returns
- A string containing the name of this class.
Definition at line 288 of file rect.h.
bool Mezzanine::UI::Rect::IsInside |
( |
const Vector2 & |
Point) | |
const |
|
inline |
Checks to see if a point in 2D space is inside this rect.
- Parameters
-
Point | The point in 2D space to check. |
- Returns
- Returns true if the provided point is within this rect, false otherwise.
Definition at line 169 of file rect.h.
bool Mezzanine::UI::Rect::IsWithinHeight |
( |
const Real & |
Position) | |
const |
|
inline |
Gets whether or point on the Y axis is within the limits of this rect or not.
- Parameters
-
Position | The point on the Y axis. |
- Returns
- Returns true in the provided position is within this rect's limits, false otherwise.
Definition at line 184 of file rect.h.
bool Mezzanine::UI::Rect::IsWithinWidth |
( |
const Real & |
Position) | |
const |
|
inline |
Gets whether or point on the X axis is within the limits of this rect or not.
- Parameters
-
Position | The point on the X axis. |
- Returns
- Returns true in the provided position is within this rect's limits, false otherwise.
Definition at line 177 of file rect.h.
bool Mezzanine::UI::Rect::operator!= |
( |
const Rect & |
Other) | |
|
|
inline |
Inequality Comparison Operator.
Checks to see if the two rects are different.
- Parameters
-
Other | The other Rect to compare against. |
Definition at line 230 of file rect.h.
Rect& Mezzanine::UI::Rect::operator= |
( |
const Rect & |
Other) | |
|
|
inline |
Assignment Operator.
Copys the contents of a Rect to another.
- Parameters
-
Other | The other Rect to copy from. |
Definition at line 213 of file rect.h.
bool Mezzanine::UI::Rect::operator== |
( |
const Rect & |
Other) | |
|
|
inline |
Equality Comparison Operator.
Checks to see if the two Rects are equal.
- Parameters
-
Other | The other Rect to compare against. |
Definition at line 223 of file rect.h.
void Mezzanine::UI::Rect::ProtoDeSerialize |
( |
const XML::Node & |
SelfRoot) | |
|
|
inline |
Take the data stored in an XML Node and overwrite this object with it.
- Parameters
-
SelfRoot | An XML::Node containing the data to populate this class with. |
Definition at line 257 of file rect.h.
void Mezzanine::UI::Rect::ProtoSerialize |
( |
XML::Node & |
ParentNode) | |
const |
|
inline |
Convert this class to an XML::Node ready for serialization.
- Parameters
-
ParentNode | The point in the XML hierarchy that all this renderable should be appended to. |
Definition at line 240 of file rect.h.
bool Mezzanine::UI::Rect::ValueInRange |
( |
const Real & |
Value, |
|
|
const Real & |
Min, |
|
|
const Real & |
Max |
|
) |
| const |
|
inlineprotected |
Simple check to see if a point is within a given range.
- Parameters
-
Value | The value to compare against the range. |
Min | The minimum value of the range. |
Max | The maximum value of the range. |
- Returns
- Returns true if the provided value is within the provided range, false otherwise.
Definition at line 65 of file rect.h.
The documentation for this class was generated from the following file:
- /home/sqeaky/Code/Mezzanine/Mezzanine/src/UI/rect.h