44 #include "UI/uienumerations.h"
45 #include "UI/textureatlas.h"
98 {
return this->Atlas->
GetName(); }
126 {
return Vector2(this->GetWidth(),this->GetHeight()); }
130 {
return this->GetUVBottom() - this->GetUVTop(); }
134 {
return this->GetUVRight() - this->GetUVLeft(); }
144 case UI::QC_BottomLeft:
return Vector2(this->Left,this->Bottom) * this->Atlas->
GetTextureSize();
break;
145 case UI::QC_BottomRight:
return Vector2(this->Right,this->Bottom) * this->Atlas->
GetTextureSize();
break;
157 case UI::QC_TopLeft:
return Vector2(this->Left,this->Top);
break;
158 case UI::QC_TopRight:
return Vector2(this->Right,this->Top);
break;
159 case UI::QC_BottomLeft:
return Vector2(this->Left,this->Bottom);
break;
160 case UI::QC_BottomRight:
return Vector2(this->Right,this->Bottom);
break;
Real GetHeight() const
Gets the sprite's height on the Atlas texture.
Vector2 GetTextureSize() const
Gets the size of the TextureAtlas.
Real GetWidth() const
Gets the sprite's width on the Atlas texture.
const String Name
The name of this sprite.
const String & GetName() const
Gets the name of this Texture Atlas.
const Real Right
The right position of this sprite on the Atlas.
const Real Bottom
The bottom position of this sprite on the Atlas.
Vector2 GetPosition() const
Gets the position of the sprite on the Atlas texture.
Real GetUVBottom() const
Gets the Bottom coordinate on the Atlas texture.
QuadCorner
Used by Sprites and Glyphs for tracking their placement on a TextureAtlas.
#define MEZZ_EXCEPTION(num, desc)
An easy way to throw exceptions with rich information.
This is a collection of smaller textures packed into a larger texture, intended to increase UI perfor...
TextureAtlas * Atlas
The TextureAtlas this sprite belongs to.
const Real Left
The left position of this sprite on the Atlas.
float Real
A Datatype used to represent a real floating point number.
const Real Top
The top position of this sprite on the Atlas.
Vector2 GetAtlasCoords(const UI::QuadCorner Corner) const
Gets the pixel position on the Atlas of a corner belonging to this Sprite.
Real Y
Coordinate on the Y vector.
Real GetUVRight() const
Gets the Right coordinate on the Atlas texture.
Real X
Coordinate on the X vector.
This is used to represent a point on a 2 dimentional area, such as a screen.
Vector2 GetRelativeAtlasCoords(const UI::QuadCorner Corner) const
Gets the relative position on the Atlas of a corner belonging to this Sprite.
Thrown when parameters are checked at runtime and found invalid.
Sprite(const String &SpriteName, const Real UVTop, const Real UVLeft, const Real UVBottom, const Real UVRight, TextureAtlas *ParentAtlas)
Class constructor.
Real GetUVTop() const
Gets the Top coordinate on the Atlas texture.
Real GetUVLeft() const
Gets the Left coordinate on the Atlas texture.
The bulk of the engine components go in this namspace.
~Sprite()
Class destructor.
Basic class used to describe a portion of a texture to be applied to a Quad.
std::string String
A datatype used to a series of characters.
Vector2 GetSize() const
Gets the size of the sprite on the Atlas texture.
const String & GetAtlasName() const
Gets the name of the atlas this sprite belongs to.