Spinning Topp Logo BlackTopp Studios
inc
Public Member Functions | Public Attributes | List of all members
Mezzanine::UI::Sprite Class Reference

Basic class used to describe a portion of a texture to be applied to a Quad. More...

#include <sprite.h>

+ Collaboration diagram for Mezzanine::UI::Sprite:

Public Member Functions

 Sprite (const String &SpriteName, const Real UVTop, const Real UVLeft, const Real UVBottom, const Real UVRight, TextureAtlas *ParentAtlas)
 Class constructor. More...
 
 ~Sprite ()
 Class destructor.
 
Vector2 GetAtlasCoords (const UI::QuadCorner Corner) const
 Gets the pixel position on the Atlas of a corner belonging to this Sprite. More...
 
const StringGetAtlasName () const
 Gets the name of the atlas this sprite belongs to.
 
Real GetHeight () const
 Gets the sprite's height on the Atlas texture. More...
 
Vector2 GetPosition () const
 Gets the position of the sprite on the Atlas texture. More...
 
Vector2 GetRelativeAtlasCoords (const UI::QuadCorner Corner) const
 Gets the relative position on the Atlas of a corner belonging to this Sprite. More...
 
Vector2 GetSize () const
 Gets the size of the sprite on the Atlas texture. More...
 
Real GetUVBottom () const
 Gets the Bottom coordinate on the Atlas texture. More...
 
Real GetUVLeft () const
 Gets the Left coordinate on the Atlas texture. More...
 
Real GetUVRight () const
 Gets the Right coordinate on the Atlas texture. More...
 
Real GetUVTop () const
 Gets the Top coordinate on the Atlas texture. More...
 
Real GetWidth () const
 Gets the sprite's width on the Atlas texture. More...
 

Public Attributes

TextureAtlasAtlas
 The TextureAtlas this sprite belongs to.
 
const Real Bottom
 The bottom position of this sprite on the Atlas.
 
const Real Left
 The left position of this sprite on the Atlas.
 
const String Name
 The name of this sprite.
 
const Real Right
 The right position of this sprite on the Atlas.
 
const Real Top
 The top position of this sprite on the Atlas.
 

Detailed Description

Basic class used to describe a portion of a texture to be applied to a Quad.

Definition at line 55 of file sprite.h.

Constructor & Destructor Documentation

Mezzanine::UI::Sprite::Sprite ( const String SpriteName,
const Real  UVTop,
const Real  UVLeft,
const Real  UVBottom,
const Real  UVRight,
TextureAtlas ParentAtlas 
)
inline

Class constructor.

Parameters
SpriteNameThe name to be given to this sprite.
UVTopThe top position of this sprite on the Atlas.
UVLeftThe left position of this sprite on the Atlas.
UVBottomThe bottom position of this sprite on the Atlas.
UVRightThe right position of this sprite on the Atlas.
ParentAtlasThe TextureAtlas this sprite belongs to.

Definition at line 65 of file sprite.h.

Member Function Documentation

Vector2 Mezzanine::UI::Sprite::GetAtlasCoords ( const UI::QuadCorner  Corner) const
inline

Gets the pixel position on the Atlas of a corner belonging to this Sprite.

Parameters
CornerThe corner to retrieve the coordinates for.
Returns
Returns a Vector2 containing the Atlas pixel position of the specific corner.

Definition at line 138 of file sprite.h.

Real Mezzanine::UI::Sprite::GetHeight ( ) const
inline

Gets the sprite's height on the Atlas texture.

Returns
Returns a Real representing the height of this sprite on the Atlas Texture in pixels.

Definition at line 129 of file sprite.h.

Vector2 Mezzanine::UI::Sprite::GetPosition ( ) const
inline

Gets the position of the sprite on the Atlas texture.

Returns
Returns a Vector2 containing the top-left position of this sprite on the Atlas texture in pixels.

Definition at line 121 of file sprite.h.

Vector2 Mezzanine::UI::Sprite::GetRelativeAtlasCoords ( const UI::QuadCorner  Corner) const
inline

Gets the relative position on the Atlas of a corner belonging to this Sprite.

Parameters
CornerThe corner to retrieve the coordinates for.
Returns
Returns a Vector2 containing the Atlas relative position of the specific corner.

Definition at line 153 of file sprite.h.

Vector2 Mezzanine::UI::Sprite::GetSize ( ) const
inline

Gets the size of the sprite on the Atlas texture.

Returns
Returns a Vector2 containing the size of this sprite on the Atlas Texture in pixels.

Definition at line 125 of file sprite.h.

Real Mezzanine::UI::Sprite::GetUVBottom ( ) const
inline

Gets the Bottom coordinate on the Atlas texture.

Returns
Returns a Real representing the bottom position of this sprite on the Atlas texture in pixels.

Definition at line 109 of file sprite.h.

Real Mezzanine::UI::Sprite::GetUVLeft ( ) const
inline

Gets the Left coordinate on the Atlas texture.

Returns
Returns a Real representing the left position of this sprite on the Atlas texture in pixels.

Definition at line 113 of file sprite.h.

Real Mezzanine::UI::Sprite::GetUVRight ( ) const
inline

Gets the Right coordinate on the Atlas texture.

Returns
Returns a Real representing the right position of this sprite on the Atlas texture in pixels.

Definition at line 117 of file sprite.h.

Real Mezzanine::UI::Sprite::GetUVTop ( ) const
inline

Gets the Top coordinate on the Atlas texture.

Returns
Returns a Real representing the top position of this sprite on the Atlas texture in pixels.

Definition at line 105 of file sprite.h.

Real Mezzanine::UI::Sprite::GetWidth ( ) const
inline

Gets the sprite's width on the Atlas texture.

Returns
Returns a Real representing the width of this sprite on the Atlas Texture in pixels.

Definition at line 133 of file sprite.h.


The documentation for this class was generated from the following file: