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... | |
const 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... | |
Boolean | GetHighlighted () const |
Gets if this character is being highlighted. More... | |
Real | GetLengthOffset () const |
Gets the length offset of this Character. 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... | |
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... | |
Boolean | IsCustomSizeSet () const |
Whether or not the custom size has been set. More... | |
Boolean | IsGlyph () const |
Gets whether or not this character is a glyph. More... | |
Boolean | IsHighlightable () const |
Gets if this character can be highlighted. More... | |
Boolean | IsNewLine () const |
Gets if this character is a line break character. More... | |
Boolean | IsRenderable () const |
Gets if this character contains valid data for rendering. More... | |
Boolean | IsSprite () const |
Gets whether or not this character is a sprite. More... | |
Boolean | 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 (Boolean 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... | |
Boolean | 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 221 of file character.cpp.
const 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 216 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 245 of file character.cpp.
Vector2 Mezzanine::UI::Character::GetCharacterSize | ( | ) | const |
Gets the rendered size of this character.
Definition at line 334 of file character.cpp.
Glyph * Mezzanine::UI::Character::GetCharGlyph | ( | ) | const |
Gets the glyph being rendered by this character.
Definition at line 368 of file character.cpp.
Sprite * Mezzanine::UI::Character::GetCharSprite | ( | ) | const |
Gets the sprite being rendered by this character.
Definition at line 371 of file character.cpp.
Boolean Mezzanine::UI::Character::GetHighlighted | ( | ) | const |
Gets if this character is being highlighted.
Definition at line 255 of file character.cpp.
Real Mezzanine::UI::Character::GetLengthOffset | ( | ) | const |
Gets the length offset of this Character.
Definition at line 315 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 228 of file character.cpp.
const CharacterTraits & Mezzanine::UI::Character::GetTraits | ( | ) | const |
Gets this Characters sharable traits.
Definition at line 268 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 352 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.
Boolean Mezzanine::UI::Character::IsCustomSizeSet | ( | ) | const |
Whether or not the custom size has been set.
Definition at line 328 of file character.cpp.
Boolean Mezzanine::UI::Character::IsGlyph | ( | ) | const |
Gets whether or not this character is a glyph.
Definition at line 273 of file character.cpp.
Boolean Mezzanine::UI::Character::IsHighlightable | ( | ) | const |
Gets if this character can be highlighted.
Definition at line 289 of file character.cpp.
Boolean Mezzanine::UI::Character::IsNewLine | ( | ) | const |
Gets if this character is a line break character.
Definition at line 301 of file character.cpp.
Boolean Mezzanine::UI::Character::IsRenderable | ( | ) | const |
Gets if this character contains valid data for rendering.
Definition at line 283 of file character.cpp.
Boolean Mezzanine::UI::Character::IsSprite | ( | ) | const |
Gets whether or not this character is a sprite.
Definition at line 278 of file character.cpp.
Boolean Mezzanine::UI::Character::IsWhiteSpace | ( | ) | const |
Gets if this character is a whitespace glyph.
Definition at line 295 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 235 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 320 of file character.cpp.
void Mezzanine::UI::Character::SetHighlighted | ( | Boolean | 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 250 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 310 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 260 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.