This class creates and encapsultes a character that can be used in text renders. More...
#include <character.h>
Public Member Functions | |
Character (const UInt32 &GlyphID, const CharacterTraits &Traits, TextLayer *Creator) | |
GlyphID Constructor. More... | |
Character (Glyph *CharacterGlyph, TextLayer *Creator) | |
Glyph Constructor. More... | |
Character (Glyph *CharacterGlyph, const CharacterTraits &Traits, TextLayer *Creator) | |
Styled Glyph Constructor. More... | |
Character (Sprite *CharacterSprite, TextLayer *Creator) | |
Sprite Constructor. More... | |
Character (Sprite *CharacterSprite, const CharacterTraits &Traits, TextLayer *Creator) | |
Styled Sprite Constructor. More... | |
TextureAtlas * | GetAtlas () const |
Gets the atlas this character is using for rendering. More... | |
Vector2 | GetAtlasCoords (const UI::QuadCorner Corner) const |
Gets the atlas coordinates of a quad corner. More... | |
String | GetAtlasName () const |
Gets the name of the atlas this character is using for rendering. More... | |
Vector2 | GetAtlasWhitePixel () const |
Gets the coordinates to the white pixel on the atlas this character belongs to. More... | |
Real | GetCharacterAdvance (Glyph *Prev) const |
Gets the amount of pixels to advance the cursor after placing this character. More... | |
const ColourValue & | GetCharacterColour () const |
Gets the fill colour of this character. More... | |
Vector2 | GetCharacterSize () const |
Gets the rendered size of this character. More... | |
Glyph * | GetCharGlyph () const |
Gets the glyph being rendered by this character. More... | |
Sprite * | GetCharSprite () const |
Gets the sprite being rendered by this character. More... | |
Boole | GetHighlighted () const |
Gets if this character is being highlighted. More... | |
Real | GetLengthOffset () const |
Gets the length offset of this Character from it's parent TextLine. More... | |
Real | GetLineHeight () const |
Gets the height a line needs to be to support rendering this character. More... | |
Vector2 | GetRelativeAtlasCoords (const UI::QuadCorner Corner) const |
Gets the relative atlas coordinates of a quad corner. More... | |
Real | GetRightEdgeLengthOffset () const |
Gets the length offset of this Characters right side from its parent TextLine. More... | |
const CharacterTraits & | GetTraits () const |
Gets this Characters sharable traits. More... | |
Real | GetUnscaledCharacterAdvance (Glyph *Prev) const |
Gets the amount of pixels to advance the cursor after placing this character without scaling applied. More... | |
Vector2 | GetUnscaledCharacterSize () const |
Gets the rendered size of this character without any scaling applied. More... | |
Real | GetUnscaledLineHeight () const |
Gets the height a line needs to be to support rendering this character without scaling applied. More... | |
Real | GetUnscaledVerticalOffset () const |
Gets the vertical adjustment for this character without scaling applied. More... | |
Real | GetVerticalOffset () const |
Gets the vertical adjustment for this character. More... | |
Boole | IsCustomSizeSet () const |
Whether or not the custom size has been set. More... | |
Boole | IsGlyph () const |
Gets whether or not this character is a glyph. More... | |
Boole | IsHighlightable () const |
Gets if this character can be highlighted. More... | |
Boole | IsNewLine () const |
Gets if this character is a line break character. More... | |
Boole | IsRenderable () const |
Gets if this character contains valid data for rendering. More... | |
Boole | IsSprite () const |
Gets whether or not this character is a sprite. More... | |
Boole | IsWhiteSpace () const |
Gets if this character is a whitespace glyph. More... | |
void | SetCharacterColour (const ColourValue &Colour) |
Sets the fill colour for this character. More... | |
void | SetCustomSize (const Vector2 &Size) |
Sets the custom size this character is to be resized to. More... | |
void | SetHighlighted (Boole Highlight) |
Sets whether or not this character should be highlighted. More... | |
void | SetLengthOffset (const Real &Offset) |
Sets the offset from the position of the parent TextLine. More... | |
void | SetTraits (const CharacterTraits &Traits) |
Sets this Characters sharable traits. More... | |
Protected Attributes | |
Glyph * | CharGlyph |
A pointer to the Glyph this character is being rendered as, or NULL if it is a Sprite. More... | |
Sprite * | CharSprite |
A pointer to the Sprite this character is being rendered as, or NULL if it is a Glyph. More... | |
CharacterTraits | CharTraits |
The rendering traits of this character. More... | |
Vector2 | CustomSize |
The forced size of this character, if it is set. More... | |
Boole | Highlighted |
Stores whether or not this character is being highlighted. More... | |
TextLayer * | Layer |
A pointer to the layer this character is being rendered by. More... | |
Real | LengthOffset |
The X-axis offset from the left side where this character is being rendered relative to the TextLine position. More... | |
This class creates and encapsultes a character that can be used in text renders.
Definition at line 59 of file character.h.
Mezzanine::UI::Character::Character | ( | const UInt32 & | GlyphID, |
const CharacterTraits & | Traits, | ||
TextLayer * | Creator | ||
) |
GlyphID Constructor.
GlyphID | The ID of the glyph to be used when creating this character. |
Traits | The sharable metadata to be given to this Character. |
Creator | The TextLayer that created this Character. |
Definition at line 56 of file character.cpp.
Mezzanine::UI::Character::Character | ( | Glyph * | CharacterGlyph, |
const CharacterTraits & | Traits, | ||
TextLayer * | Creator | ||
) |
Sprite Constructor.
CharacterSprite | The sprite used when rendering this character. |
Creator | The TextLayer that created this Character. |
Definition at line 101 of file character.cpp.
Mezzanine::UI::Character::Character | ( | Sprite * | CharacterSprite, |
const CharacterTraits & | Traits, | ||
TextLayer * | Creator | ||
) |
TextureAtlas * Mezzanine::UI::Character::GetAtlas | ( | ) | const |
Gets the atlas this character is using for rendering.
Definition at line 196 of file character.cpp.
Vector2 Mezzanine::UI::Character::GetAtlasCoords | ( | const UI::QuadCorner | Corner | ) | const |
Gets the atlas coordinates of a quad corner.
Corner | The corner to get the atlas coordinates for. |
Definition at line 219 of file character.cpp.
String Mezzanine::UI::Character::GetAtlasName | ( | ) | const |
Gets the name of the atlas this character is using for rendering.
Definition at line 207 of file character.cpp.
Vector2 Mezzanine::UI::Character::GetAtlasWhitePixel | ( | ) | const |
Gets the coordinates to the white pixel on the atlas this character belongs to.
Definition at line 214 of file character.cpp.
Gets the amount of pixels to advance the cursor after placing this character.
Prev | The glyph prior to this one in the parent TextLine. Needed for kerning information. |
Definition at line 129 of file character.cpp.
const ColourValue & Mezzanine::UI::Character::GetCharacterColour | ( | ) | const |
Gets the fill colour of this character.
Definition at line 243 of file character.cpp.
Vector2 Mezzanine::UI::Character::GetCharacterSize | ( | ) | const |
Gets the rendered size of this character.
Definition at line 341 of file character.cpp.
Glyph * Mezzanine::UI::Character::GetCharGlyph | ( | ) | const |
Gets the glyph being rendered by this character.
Definition at line 375 of file character.cpp.
Sprite * Mezzanine::UI::Character::GetCharSprite | ( | ) | const |
Gets the sprite being rendered by this character.
Definition at line 378 of file character.cpp.
Boole Mezzanine::UI::Character::GetHighlighted | ( | ) | const |
Gets if this character is being highlighted.
Definition at line 257 of file character.cpp.
Real Mezzanine::UI::Character::GetLengthOffset | ( | ) | const |
Gets the length offset of this Character from it's parent TextLine.
Definition at line 317 of file character.cpp.
Real Mezzanine::UI::Character::GetLineHeight | ( | ) | const |
Gets the height a line needs to be to support rendering this character.
Definition at line 155 of file character.cpp.
Vector2 Mezzanine::UI::Character::GetRelativeAtlasCoords | ( | const UI::QuadCorner | Corner | ) | const |
Gets the relative atlas coordinates of a quad corner.
Corner | The corner to retrieve the coordinates for. |
Definition at line 226 of file character.cpp.
Real Mezzanine::UI::Character::GetRightEdgeLengthOffset | ( | ) | const |
Gets the length offset of this Characters right side from its parent TextLine.
Definition at line 322 of file character.cpp.
const CharacterTraits & Mezzanine::UI::Character::GetTraits | ( | ) | const |
Gets this Characters sharable traits.
Definition at line 270 of file character.cpp.
Gets the amount of pixels to advance the cursor after placing this character without scaling applied.
Prev | The glyph prior to this one in the parent TextLine. Needed for kerning information. |
Definition at line 143 of file character.cpp.
Vector2 Mezzanine::UI::Character::GetUnscaledCharacterSize | ( | ) | const |
Gets the rendered size of this character without any scaling applied.
Definition at line 359 of file character.cpp.
Real Mezzanine::UI::Character::GetUnscaledLineHeight | ( | ) | const |
Gets the height a line needs to be to support rendering this character without scaling applied.
Definition at line 164 of file character.cpp.
Real Mezzanine::UI::Character::GetUnscaledVerticalOffset | ( | ) | const |
Gets the vertical adjustment for this character without scaling applied.
Definition at line 185 of file character.cpp.
Real Mezzanine::UI::Character::GetVerticalOffset | ( | ) | const |
Gets the vertical adjustment for this character.
Definition at line 176 of file character.cpp.
Boole Mezzanine::UI::Character::IsCustomSizeSet | ( | ) | const |
Whether or not the custom size has been set.
Definition at line 335 of file character.cpp.
Boole Mezzanine::UI::Character::IsGlyph | ( | ) | const |
Gets whether or not this character is a glyph.
Definition at line 275 of file character.cpp.
Boole Mezzanine::UI::Character::IsHighlightable | ( | ) | const |
Gets if this character can be highlighted.
Definition at line 291 of file character.cpp.
Boole Mezzanine::UI::Character::IsNewLine | ( | ) | const |
Gets if this character is a line break character.
Definition at line 303 of file character.cpp.
Boole Mezzanine::UI::Character::IsRenderable | ( | ) | const |
Gets if this character contains valid data for rendering.
Definition at line 285 of file character.cpp.
Boole Mezzanine::UI::Character::IsSprite | ( | ) | const |
Gets whether or not this character is a sprite.
Definition at line 280 of file character.cpp.
Boole Mezzanine::UI::Character::IsWhiteSpace | ( | ) | const |
Gets if this character is a whitespace glyph.
Definition at line 297 of file character.cpp.
void Mezzanine::UI::Character::SetCharacterColour | ( | const ColourValue & | Colour | ) |
Sets the fill colour for this character.
Colour | The colour to render this character with. |
Definition at line 233 of file character.cpp.
void Mezzanine::UI::Character::SetCustomSize | ( | const Vector2 & | Size | ) |
Sets the custom size this character is to be resized to.
Size | The custom size to apply to this character in pixels. |
Definition at line 327 of file character.cpp.
void Mezzanine::UI::Character::SetHighlighted | ( | Boole | Highlight | ) |
Sets whether or not this character should be highlighted.
Highlight | True to highlight this character, false to remove a highlight on it. |
Definition at line 248 of file character.cpp.
void Mezzanine::UI::Character::SetLengthOffset | ( | const Real & | Offset | ) |
Sets the offset from the position of the parent TextLine.
Offset | The placement offset from the parent's origin in pixels. |
Definition at line 312 of file character.cpp.
void Mezzanine::UI::Character::SetTraits | ( | const CharacterTraits & | Traits | ) |
Sets this Characters sharable traits.
Traits | The traits to be given to this Character. |
Definition at line 262 of file character.cpp.
|
protected |
A pointer to the Glyph this character is being rendered as, or NULL if it is a Sprite.
Definition at line 73 of file character.h.
|
protected |
A pointer to the Sprite this character is being rendered as, or NULL if it is a Glyph.
Definition at line 76 of file character.h.
|
protected |
The rendering traits of this character.
Definition at line 64 of file character.h.
|
protected |
The forced size of this character, if it is set.
Definition at line 67 of file character.h.
|
protected |
Stores whether or not this character is being highlighted.
Definition at line 82 of file character.h.
|
protected |
A pointer to the layer this character is being rendered by.
Definition at line 70 of file character.h.
|
protected |
The X-axis offset from the left side where this character is being rendered relative to the TextLine position.
Definition at line 79 of file character.h.