This class is a helper class, specifically for use with background sprites and colours. More...
#include <uirectangle.h>
Public Member Functions | |
| Rectangle (const RenderableRect &Rect, Layer *PLayer) | |
| Class constructor. | |
| virtual | ~Rectangle () |
| Class destructor. | |
| virtual void | _AppendVertices (ScreenVertexData &Vertices) |
| virtual void | _Redraw () |
| virtual bool | CheckMouseHover () |
| Determines whether the mouse is over this renderable. | |
| virtual Vector2 | GetActualPosition () const |
| Gets the top left position of this renderable in pixels. | |
| virtual Vector2 | GetActualSize () const |
| Gets the size of this renderable in pixels. | |
| virtual ColourValue | GetBackgroundColour (const UI::QuadCorner &Corner) const |
| Gets the colour of a corner of this renderable. | |
| virtual ColourValue | GetBorderColour (const UI::Border &Side) const |
| Gets the colour of a border on this renderable. | |
| virtual Real | GetBorderWidth () const |
| Gets the border width of this renderable. | |
| virtual bool | GetMouseHover () |
| Gets the stored value of whether or not the mouse is over the renderable. | |
| virtual Vector2 | GetPosition () const |
| Gets the relative top left position of this renderable. | |
| virtual Vector2 | GetRotationCenter () const |
| Gets the current set rotation point. | |
| virtual Real | GetRotationDegrees () const |
| Gets the current rotation applied to this renderable in degrees. | |
| virtual Real | GetRotationRadians () const |
| Gets the current rotation applied to this renderable in radians. | |
| virtual Vector2 | GetSize () const |
| Gets the relative size of this renderable. | |
| virtual void | NoBorder () |
| Disables any border set on this renderable if one is currently set. | |
| virtual void | SetActualPosition (const Vector2 &Position) |
| Sets the top left position of this renderable in pixels. | |
| virtual void | SetActualSize (const Vector2 &Size) |
| Sets the size of this renderable in pixels. | |
| virtual void | SetBackgroundColour (const ColourValue &Colour) |
| Sets the background colour of the renderable. | |
| virtual void | SetBackgroundColour (const UI::QuadCorner &Corner, const ColourValue &Colour) |
| Sets the background colour for one corner the renderable. | |
| virtual void | SetBackgroundGradient (const UI::Gradient &Grad, const ColourValue &ColourA, const ColourValue &ColourB) |
| Sets a colour gradient to be applied to this renderable. | |
| virtual void | SetBackgroundSprite (const String &SpriteName) |
| Sets the background image(if provided in the atlas) of the renderable. | |
| virtual void | SetBackgroundSprite (Sprite *PSprite) |
| Sets the background image(if provided in the atlas) of the renderable. | |
| virtual void | SetBackgroundSprite (const String &SpriteName, const String &Atlas) |
| Sets the background image(if provided in the atlas) of the renderable. | |
| virtual void | SetBorder (const Real &Width, const ColourValue &North, const ColourValue &South, const ColourValue &East, const ColourValue &West) |
| Sets all parameters for enabling a border. | |
| virtual void | SetBorder (const Real &Width, const ColourValue &Colour) |
| Sets all parameters for enabling a border. | |
| virtual void | SetBorderColour (const UI::Border &Side, const ColourValue &Colour) |
| Sets the colour of one side of the border for this renderable. | |
| virtual void | SetBorderColour (const ColourValue &Colour) |
| Sets the colour of the border for this renderable. | |
| virtual void | SetBorderWidth (const Real &Width) |
| Sets the width of the border for this renderable. | |
| virtual void | SetPosition (const Vector2 &Position) |
| Sets the relative top left position of this renderable. | |
| virtual void | SetRotationCenter (bool Custom, const Vector2 &Center=Vector2()) |
| Sets the point around which this renderable should rotate. | |
| virtual void | SetRotationDegrees (const Real &Degrees) |
| Sets the rotation to be applied to this renderable. | |
| virtual void | SetRotationRadians (const Real &Radians) |
| Sets the rotation to be applied to this renderable. | |
| virtual void | SetSize (const Vector2 &Size) |
| Sets the relative size of this renderable. | |
| virtual void | UpdateDimensions () |
| Updates the dimensions of this renderable to match those of the new screen size. | |
Protected Member Functions | |
| Rectangle (const String &name, const RenderableRect &Rect, Layer *PLayer) | |
| Inheritance constructor. | |
| virtual void | ConstructRectangle (const UI::RenderableRect &Rect) |
| Builds the rectangle. | |
| virtual void | DrawBorder (const Vector2 &TopLeft, const Vector2 &TopRight, const Vector2 &BottomLeft, const Vector2 &BottomRight, const Vector2 &OuterTopLeft, const Vector2 &OuterTopRight, const Vector2 &OuterBottomLeft, const Vector2 &OuterBottomRight) |
| Draws the border, if any is set. | |
| virtual void | DrawFill (const Vector2 &TopLeft, const Vector2 &TopRight, const Vector2 &BottomLeft, const Vector2 &BottomRight) |
| Draws the main rectangle. | |
| virtual void | RotationTransform (Vector2 &TopLeft, Vector2 &TopRight, Vector2 &BottomLeft, Vector2 &BottomRight) |
| Transforms coordinates to be used in rendering. | |
| virtual void | SetHovered (bool Hovered) |
| Sets the hovered state of this renderable. | |
| virtual void | SetSprite (Sprite *PSprite) |
| Sets all the sprite meta-data of this class to render a specific sprite. | |
Protected Attributes | |
| Vector2 | ActPosition |
| Vector2 | ActSize |
| ColourValue | BackgroundColours [4] |
| ColourValue | BorderColours [4] |
| Real | BorderWidth |
| bool | CustomCenter |
| bool | MouseHover |
| Vector2 | RelPosition |
| Vector2 | RelSize |
| Real | RotAngle |
| Vector2 | RotCenter |
| Vector2 | UVs [4] |
This class is a helper class, specifically for use with background sprites and colours.
Unlike a button, this class cannot be interacted with by clicking. It is important to understand what you want your space to do when selecting the class to use.
Definition at line 62 of file uirectangle.h.
| Mezzanine::UI::Rectangle::Rectangle | ( | const String & | name, |
| const RenderableRect & | Rect, | ||
| Layer * | PLayer | ||
| ) | [protected] |
Inheritance constructor.
| name | The name to be given to this renderable. |
| Rect | The Rect representing the position and size of the rectangle. |
| Layer | Pointer to the parent Layer that created this rectangle. |
Definition at line 67 of file uirectangle.cpp.
| Mezzanine::UI::Rectangle::Rectangle | ( | const RenderableRect & | Rect, |
| Layer * | PLayer | ||
| ) |
Class constructor.
| Rect | The Rect representing the position and size of the rectangle. |
| Layer | Pointer to the parent Layer that created this rectangle. |
Definition at line 57 of file uirectangle.cpp.
| void Mezzanine::UI::Rectangle::_AppendVertices | ( | ScreenVertexData & | Vertices | ) | [virtual] |
Appends the vertices of this renderable to another vector.
| Vertices | The vector of vertex's to append to. |
Implements Mezzanine::UI::BasicRenderable.
Definition at line 570 of file uirectangle.cpp.
| void Mezzanine::UI::Rectangle::_Redraw | ( | ) | [virtual] |
Regenerates the verticies in this renderable.
Implements Mezzanine::UI::BasicRenderable.
Reimplemented in Mezzanine::UI::Caption, Mezzanine::UI::MarkupText, and Mezzanine::UI::TextButton.
Definition at line 471 of file uirectangle.cpp.
| bool Mezzanine::UI::Rectangle::CheckMouseHover | ( | ) | [virtual] |
Determines whether the mouse is over this renderable.
Definition at line 229 of file uirectangle.cpp.
| Vector2 Mezzanine::UI::Rectangle::GetActualPosition | ( | ) | const [virtual] |
Gets the top left position of this renderable in pixels.
Definition at line 433 of file uirectangle.cpp.
| Vector2 Mezzanine::UI::Rectangle::GetActualSize | ( | ) | const [virtual] |
Gets the size of this renderable in pixels.
Definition at line 459 of file uirectangle.cpp.
| ColourValue Mezzanine::UI::Rectangle::GetBackgroundColour | ( | const UI::QuadCorner & | Corner | ) | const [virtual] |
Gets the colour of a corner of this renderable.
| Corner | The corner to get the colour for. |
Definition at line 321 of file uirectangle.cpp.
| ColourValue Mezzanine::UI::Rectangle::GetBorderColour | ( | const UI::Border & | Side | ) | const [virtual] |
Gets the colour of a border on this renderable.
| Side | The side to retrieve the colour for. |
Definition at line 373 of file uirectangle.cpp.
| Real Mezzanine::UI::Rectangle::GetBorderWidth | ( | ) | const [virtual] |
Gets the border width of this renderable.
Definition at line 368 of file uirectangle.cpp.
| bool Mezzanine::UI::Rectangle::GetMouseHover | ( | ) | [virtual] |
Gets the stored value of whether or not the mouse is over the renderable.
This function does not perform any checks. If you want to do a manual check, call CheckMouseHover().
Definition at line 241 of file uirectangle.cpp.
| Vector2 Mezzanine::UI::Rectangle::GetPosition | ( | ) | const [virtual] |
Gets the relative top left position of this renderable.
Definition at line 420 of file uirectangle.cpp.
| Vector2 Mezzanine::UI::Rectangle::GetRotationCenter | ( | ) | const [virtual] |
Gets the current set rotation point.
Definition at line 407 of file uirectangle.cpp.
| Real Mezzanine::UI::Rectangle::GetRotationDegrees | ( | ) | const [virtual] |
Gets the current rotation applied to this renderable in degrees.
Definition at line 390 of file uirectangle.cpp.
| Real Mezzanine::UI::Rectangle::GetRotationRadians | ( | ) | const [virtual] |
Gets the current rotation applied to this renderable in radians.
Definition at line 395 of file uirectangle.cpp.
| Vector2 Mezzanine::UI::Rectangle::GetSize | ( | ) | const [virtual] |
Gets the relative size of this renderable.
Definition at line 446 of file uirectangle.cpp.
| void Mezzanine::UI::Rectangle::SetActualPosition | ( | const Vector2 & | Position | ) | [virtual] |
Sets the top left position of this renderable in pixels.
| Position | A Vector2 representing the location of this renderable. |
Definition at line 425 of file uirectangle.cpp.
| void Mezzanine::UI::Rectangle::SetActualSize | ( | const Vector2 & | Size | ) | [virtual] |
Sets the size of this renderable in pixels.
| Size | A vector2 representing the size of this renderable. |
Definition at line 451 of file uirectangle.cpp.
| void Mezzanine::UI::Rectangle::SetBackgroundColour | ( | const ColourValue & | Colour | ) | [virtual] |
Sets the background colour of the renderable.
| Colour | A colour value representing the colour to be set. |
Definition at line 246 of file uirectangle.cpp.
| void Mezzanine::UI::Rectangle::SetBackgroundColour | ( | const UI::QuadCorner & | Corner, |
| const ColourValue & | Colour | ||
| ) | [virtual] |
Sets the background colour for one corner the renderable.
| Corner | Which corner the colour should be applied to. |
| Colour | A colour value representing the colour to be set. |
Definition at line 255 of file uirectangle.cpp.
| void Mezzanine::UI::Rectangle::SetBackgroundGradient | ( | const UI::Gradient & | Grad, |
| const ColourValue & | ColourA, | ||
| const ColourValue & | ColourB | ||
| ) | [virtual] |
Sets a colour gradient to be applied to this renderable.
| Grad | The direction/style of gradient to enable. |
| ColourA | The colour to apply to the first side of the gradient. |
| ColourB | The colour to apply to the second side of the gradient. |
Definition at line 278 of file uirectangle.cpp.
| void Mezzanine::UI::Rectangle::SetBackgroundSprite | ( | Sprite * | PSprite | ) | [virtual] |
Sets the background image(if provided in the atlas) of the renderable.
| PSprite | A pointer to the sprite to set as the background. |
Reimplemented in Mezzanine::UI::Button.
Definition at line 261 of file uirectangle.cpp.
| void Mezzanine::UI::Rectangle::SetBackgroundSprite | ( | const String & | SpriteName | ) | [virtual] |
Sets the background image(if provided in the atlas) of the renderable.
| SpriteName | The name of the sprite to set as the background. |
Reimplemented in Mezzanine::UI::Button.
Definition at line 266 of file uirectangle.cpp.
| void Mezzanine::UI::Rectangle::SetBackgroundSprite | ( | const String & | SpriteName, |
| const String & | Atlas | ||
| ) | [virtual] |
Sets the background image(if provided in the atlas) of the renderable.
| SpriteName | The name of the sprite to set as the background. |
| Atlas | The Atlas to load the sprite from. |
Reimplemented in Mezzanine::UI::Button.
Definition at line 272 of file uirectangle.cpp.
| void Mezzanine::UI::Rectangle::SetBorder | ( | const Real & | Width, |
| const ColourValue & | Colour | ||
| ) | [virtual] |
Sets all parameters for enabling a border.
| Width | The width to set for the border. |
| Colour | The colour to be applied to all sides of the border. |
Definition at line 347 of file uirectangle.cpp.
| void Mezzanine::UI::Rectangle::SetBorder | ( | const Real & | Width, |
| const ColourValue & | North, | ||
| const ColourValue & | South, | ||
| const ColourValue & | East, | ||
| const ColourValue & | West | ||
| ) | [virtual] |
Sets all parameters for enabling a border.
| Width | The width to set for the border. |
| North | The colour to apply to the north side of the border. |
| South | The colour to apply to the south side of the border. |
| East | The colour to apply to the east side of the border. |
| West | The colour to apply to the west side of the border. |
Definition at line 353 of file uirectangle.cpp.
| void Mezzanine::UI::Rectangle::SetBorderColour | ( | const ColourValue & | Colour | ) | [virtual] |
Sets the colour of the border for this renderable.
| Colour | The colour to set for the border. |
Definition at line 332 of file uirectangle.cpp.
| void Mezzanine::UI::Rectangle::SetBorderColour | ( | const UI::Border & | Side, |
| const ColourValue & | Colour | ||
| ) | [virtual] |
Sets the colour of one side of the border for this renderable.
| Side | The side to have the colour applied to. |
| Colour | The colour to be applied. |
Definition at line 341 of file uirectangle.cpp.
| void Mezzanine::UI::Rectangle::SetBorderWidth | ( | const Real & | Width | ) | [virtual] |
Sets the width of the border for this renderable.
| Width | The width to set for the border. |
Definition at line 326 of file uirectangle.cpp.
| void Mezzanine::UI::Rectangle::SetPosition | ( | const Vector2 & | Position | ) | [virtual] |
Sets the relative top left position of this renderable.
| Position | A Vector2 representing the location of this renderable. |
Definition at line 412 of file uirectangle.cpp.
| void Mezzanine::UI::Rectangle::SetRotationCenter | ( | bool | Custom, |
| const Vector2 & | Center = Vector2() |
||
| ) | [virtual] |
Sets the point around which this renderable should rotate.
| Custom | Whether to enable or disable a custom rotation point. |
| Center | The point in screen space where this renderable should rotate around. |
Definition at line 400 of file uirectangle.cpp.
| void Mezzanine::UI::Rectangle::SetRotationDegrees | ( | const Real & | Degrees | ) | [virtual] |
Sets the rotation to be applied to this renderable.
| Degrees | The angle of rotation in degrees. |
Definition at line 378 of file uirectangle.cpp.
| void Mezzanine::UI::Rectangle::SetRotationRadians | ( | const Real & | Radians | ) | [virtual] |
Sets the rotation to be applied to this renderable.
| Radians | The angle of rotation in radians. |
Definition at line 384 of file uirectangle.cpp.
| void Mezzanine::UI::Rectangle::SetSize | ( | const Vector2 & | Size | ) | [virtual] |
Sets the relative size of this renderable.
| Size | A vector2 representing the size of this renderable. |
Definition at line 438 of file uirectangle.cpp.
| void Mezzanine::UI::Rectangle::UpdateDimensions | ( | ) | [virtual] |
Updates the dimensions of this renderable to match those of the new screen size.
This function is called automatically when a viewport changes in size, and shouldn't need to be called manually.
Implements Mezzanine::UI::BasicRenderable.
Reimplemented in Mezzanine::UI::Caption, Mezzanine::UI::MarkupText, and Mezzanine::UI::TextButton.
Definition at line 464 of file uirectangle.cpp.
1.7.3