41 #ifndef _uitextlayer_cpp
42 #define _uitextlayer_cpp
44 #include "UI/textlayer.h"
45 #include "UI/textline.h"
46 #include "UI/textcursor.h"
47 #include "UI/texttoken.h"
48 #include "UI/defaultmarkupparser.h"
49 #include "UI/widget.h"
50 #include "UI/screen.h"
52 #include "UI/uimanager.h"
54 #include "stringtool.h"
55 #include "MathTools/mathtools.h"
63 ManualCharScaling(1.0,1.0),
71 MaxLineWidth(this->Parent->GetActualSize().X),
74 AutoCharScalingMode(
TextLayer::SM_NoAutoScaling),
76 VerticalAlign(UI::LA_TopLeft)
97 ManualCharScaling(1.0,1.0),
105 MaxLineWidth(this->Parent->GetActualSize().X),
106 AutoCharScaling(0.0),
108 AutoCharScalingMode(
TextLayer::SM_NoAutoScaling),
110 VerticalAlign(UI::LA_TopLeft)
132 ManualCharScaling(1.0,1.0),
140 MaxLineWidth(this->Parent->GetActualSize().X),
141 AutoCharScaling(LineHeight),
143 AutoCharScalingMode(
TextLayer::SM_ScreenRelative),
145 VerticalAlign(UI::LA_TopLeft)
194 Vector2 TopLeft, TopRight, BottomLeft, BottomRight;
195 Vector2 PrevHLTopRight, PrevHLBottomRight;
209 CurrLine = (*LineIt);
224 CurrChar = (*CharIt);
234 TopLeft.
SetValues( MathTools::Floor( CursorX - TexelOffsetX ),
235 MathTools::Floor( (CursorY + TexelOffsetY + VertOffset) - CharSize.
Y ) );
236 BottomRight.
SetValues( MathTools::Floor( (CursorX - TexelOffsetX) + CharSize.
X ),
237 MathTools::Floor( CursorY + TexelOffsetY + VertOffset ) );
250 if( PrevHLTopRight.
X > -1 && PrevHLTopRight.
Y > -1 && PrevHLBottomRight.
X > -1 && PrevHLBottomRight.
Y > -1 ) {
252 PushVertex(PrevHLBottomRight.
X, PrevHLBottomRight.
Y, WhitePixelCoords, HighlightColour, CharAtlas);
253 PushVertex(TopRight.
X, TopRight.
Y, WhitePixelCoords, HighlightColour, CharAtlas);
254 PushVertex(PrevHLTopRight.
X, PrevHLTopRight.
Y, WhitePixelCoords, HighlightColour, CharAtlas);
257 PushVertex(PrevHLBottomRight.
X, PrevHLBottomRight.
Y, WhitePixelCoords, HighlightColour, CharAtlas);
258 PushVertex(BottomRight.
X, BottomRight.
Y, WhitePixelCoords, HighlightColour, CharAtlas);
259 PushVertex(TopRight.
X, TopRight.
Y, WhitePixelCoords, HighlightColour, CharAtlas);
262 PushVertex(BottomLeft.
X, BottomLeft.
Y, WhitePixelCoords, HighlightColour, CharAtlas);
263 PushVertex(TopRight.
X, TopRight.
Y, WhitePixelCoords, HighlightColour, CharAtlas);
264 PushVertex(TopLeft.
X, TopLeft.
Y, WhitePixelCoords, HighlightColour, CharAtlas);
267 PushVertex(BottomLeft.
X, BottomLeft.
Y, WhitePixelCoords, HighlightColour, CharAtlas);
268 PushVertex(BottomRight.
X, BottomRight.
Y, WhitePixelCoords, HighlightColour, CharAtlas);
269 PushVertex(TopRight.
X, TopRight.
Y, WhitePixelCoords, HighlightColour, CharAtlas);
272 PrevHLTopRight = TopRight;
273 PrevHLBottomRight = BottomRight;
298 BottomRight.
SetValues( TopRight.
X , BottomLeft.
Y );
319 if( TotalHeight < ActDims.
Size.
Y )
323 case UI::LA_TopLeft:
break;
324 case UI::LA_BottomRight: CursorY = ActDims.
Size.
Y - TotalHeight;
break;
325 case UI::LA_Center: CursorY = (ActDims.
Size.
Y * 0.5) - (TotalHeight * 0.5);
break;
331 CursorY += (*TLIt)->GetLineHeight();
332 (*TLIt)->SetPositionOffset(CursorY);
341 if( Parser != NULL ) {
368 Ret += (*TextIt)->GetLineHeight();
386 default:
return 0;
break;
415 ExceptionStream <<
"Attempting to set text on a TextLayer without a default font set. Layer owned by renderable \"" <<
Parent->
GetName() <<
"\".";
555 if( static_cast<Whole>(Index) < this->
Characters.size() ) {
557 (*ToHighlight)->SetHighlighted(
true);
570 while( StartIterator != EndIterator )
572 (*StartIterator)->SetHighlighted(
true);
598 while( StartIterator != EndIterator )
600 (*StartIterator)->SetHighlighted(
false);
651 return ( this->
Cursor != NULL );
681 if( Offset < (*LineIt)->GetPositionOffset() - (*LineIt)->GetLineHeight() )
684 while( LineIt != this->
TextLines.end() && Offset < (*LineIt)->GetPositionOffset() )
690 if( LineIt == (--this->
TextLines.end()) && Offset > (*LineIt)->GetPositionOffset() )
712 { (*TLIt)->RemoveAllCharacters(); }
729 { (*TLIt)->SetAlignment(Align); }
776 while( LineIt != this->
TextLines.end() && Offset.
Y > (*LineIt)->GetPositionOffset() )
784 if( Offset.
X < (*LineIt)->GetLeftMostCursorPosition() ||
785 Offset.
X > (*LineIt)->GetRightMostCursorPosition() )
792 while( CharIt != (*LineIt)->EndCharacter() && Offset.
X > (*CharIt)->GetLengthOffset() + (*CharIt)->GetCharacterSize().X )
799 if( CharIt == (*LineIt)->EndCharacter() )
return NULL;
800 else return (*CharIt);
805 if( 0 > Index || static_cast<Whole>(Index) >= this->
Characters.size() ) {
821 if( 0 > Index || static_cast<Whole>(Index) >= this->
Characters.size() ) {
853 Integer OldSize = this->Characters.size();
859 return ( this->Characters.size() - OldSize );
864 Integer OldSize = this->Characters.size();
870 return ( this->Characters.size() - OldSize );
908 {
delete (*CharIt); }
1017 if( !PropertiesNode.
Empty() ) {
1019 CurrAttrib = PropertiesNode.
GetAttribute(
"HighlightStart");
1020 if( !CurrAttrib.
Empty() )
1023 CurrAttrib = PropertiesNode.
GetAttribute(
"HighlightEnd");
1024 if( !CurrAttrib.
Empty() )
1027 CurrAttrib = PropertiesNode.
GetAttribute(
"MaxLineWidth");
1028 if( !CurrAttrib.
Empty() )
1031 CurrAttrib = PropertiesNode.
GetAttribute(
"AutoCharScaling");
1032 if( !CurrAttrib.
Empty() )
1035 CurrAttrib = PropertiesNode.
GetAttribute(
"AutoCharScalingMode");
1036 if( !CurrAttrib.
Empty() )
1039 CurrAttrib = PropertiesNode.
GetAttribute(
"HorizontalOrder");
1040 if( !CurrAttrib.
Empty() )
1043 CurrAttrib = PropertiesNode.
GetAttribute(
"VerticalAlign");
1044 if( !CurrAttrib.
Empty() )
1048 if( !DefaultCharTraitsNode.
Empty() )
1052 if( !ActiveHLColourNode.
Empty() )
1056 if( !InactiveHLColourNode.
Empty() )
1060 if( !CharScalingNode.
Empty() )
1073 if( !CursorNode.
Empty() ) {
1086 if( !TextNode.
Empty() ) {
1089 if( !CurrAttrib.
Empty() )
1103 {
return "TextLayer"; }
UI::LinearAlignment VerticalAlign
The alignment TextLines will have.
This contains simple tools for indexing with UTF8 characters swiftly.
virtual Integer InsertCharacterAtIndex(const Integer Index, const UInt32 GlyphID)
Creates a character from a Glyph ID and inserts it into the layer at the specified index...
virtual void ProtoDeSerializeProperties(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite the properties of this object with it...
Characters/New Lines originate from the left, and advance to the right.
std::pair< Boole, Vector2 > CharOffsetPair
An std::pair type used as a return for index-offset conversions.
virtual CharacterContainer ParseTextTokens(TokenString *Tokens, const CharacterTraits &InitialTraits, TextLayer *CallingLayer) const
Processes a collection of text tokens into a list of renderable characters.
Attribute AppendAttribute(const Char8 *Name)
Creates an Attribute and puts it at the end of this Nodes attributes.
This class represents a collection of Glyphs in a common visual style.
virtual CharIndexPair GetIndexAtOffsetImpl(const Vector2 &Position)=0
Gets the index of the character at the specified offset position.
const String & GetName() const
Gets the name of this renderable.
void ProtoDeSerialize(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite this object with it.
virtual TextLineIterator BeginTextLine()
Gets an iterator to the first TextLine.
virtual void ProtoSerializeProperties(XML::Node &SelfRoot) const
Convert the properties of this class to an XML::Node ready for serialization.
A light-weight handle for manipulating attributes in DOM tree.
virtual void SetTextLineVerticalAlignment(const UI::LinearAlignment Align)
Sets the alignment used to determine the start position of the textlines in this layer.
virtual UInt32 RemoveCharacters(const UInt32 Index, const UInt32 Length)
Removes rendered characters from this string.
virtual const ColourValue & GetTextColour() const
Gets the default colour of the tect being rendered by this layer.
This is a helper class that facilitates operations with collections of tokens generated from Markup P...
virtual TextLineIterator EndTextLine()
Gets an iterator to one passed the last TextLine.
Real GetPositionOffset() const
Gets the offset on the Y axis from the parent layer.
virtual CharacterIterator GetCharacterIteratorAtIndex(const Integer Index)
Gets an iterator to the character at the specified index.
bool Boole
Generally acts a single bit, true or false.
virtual Real GetCursorStartPosition() const =0
Gets the offset position of the cursor based on the text order of the layer this text line belongs to...
void ProtoSerialize(XML::Node &ParentNode) const
Convert this class to an XML::Node ready for serialization.
CharacterIterator BeginCharacter()
Gets an iterator to the first Character.
static ColourValue Blue()
Creates a ColourValue representing the colour Blue.
virtual void RotationTransform(Vector2 &Point, const Vector2 &RotationCenter)
Applies rotation to a point in 2D space.
virtual Real GetTotalHeight() const
Gets the combined height of all the text lines in this layer.
virtual UI::LinearAlignment GetTextLineVerticalAlignment() const
Gets the current set alignment for positioning textlines in this layer.
virtual Rect GetAreaRect() const
Gets a rect containing the actual position and size of this layer.
Vector2 Size
Vector2 representing the width and height of the rect.
CharacterContainer Characters
Container with all this layers Characters.
virtual void ProtoSerialize(XML::Node &ParentNode) const
Convert this class to an XML::Node ready for serialization.
CharacterIterator EndCharacter()
Gets an iterator to one passed the last Character.
CharacterIterator BeginCharacter()
Gets an iterator to the first Character.
virtual void SetAutoTextScale(const TextLayer::ScalingMode Mode, const Real Scalar)
Sets the mode and scaler of auto-scaling applied to the text generated by this textlayer.
Thrown when the requested identity could not be found.
Node GetFirstChild() const
Get the first child Node of this Node.
#define MEZZ_EXCEPTION(num, desc)
An easy way to throw exceptions with rich information.
The provided scaler will be treated as relative to this layers Y size after layer scaling...
MarkupParser * MUParser
The parser to use when converting raw strings to renderable characters.
QuadRenderable * Parent
A pointer to the parent of this RenderLayer.
virtual UInt32 InsertCharacter(const UInt32 Index, UInt32 UChar)
Inserts a single UTF-32 size character into this string.
virtual void ProtoSerializeProperties(XML::Node &SelfRoot) const
Convert the properties of this class to an XML::Node ready for serialization.
String PriAtlas
This contains the name of the atlas that will be used as default when one isn't specified.
Boole IsRenderable() const
Gets if this character contains valid data for rendering.
int Integer
A datatype used to represent any integer close to.
Vector2 GetRelativeAtlasCoords(const UI::QuadCorner Corner) const
Gets the relative atlas coordinates of a quad corner.
Thrown when a version is accessed/parsed/required and it cannot work correctly or is missing...
static ColourValue White()
Creates a ColourValue representing the colour White.
virtual TokenString * Lex(const String &Source) const
Converts a string into a series of tokens that can be parsed more readily.
const Char8 * AsString(const Char8 *def="") const
Attempts to convert the value of the attribute to a String and returns the results.
virtual void SetInactiveHighlightBackgroundColour(const ColourValue &Colour)
Sets the colour of the highlight when the quad is not focused.
Real GetLengthOffset() const
Gets the length offset of this Character from it's parent TextLine.
virtual ~TextLayer()
Class destructor.
virtual Boole SetMarkupParser(MarkupParser *Parser)
Sets the MarkupParser to be used by this TextLayer.
FontData * GetFont(const String &FontName, const String &Atlas) const
Gets the specified FontData from an Atlas.
Screen * GetScreen() const
Gets the parent screen of this renderable.
This class represents a box shaped area on the screen.
Vector2 GetCharacterSize() const
Gets the rendered size of this character.
TextOrdering
This enum describes the direction of advancing characters or lines along the X axis.
This is a simple class for holding 4 reals representing the colour any give object or lightsource can...
Real MaxLineWidth
The maximum width of textlines generated by this layer in pixels.
virtual void _MarkDirty()
Marks this renderable as well as all parent objects as dirty.
bool Empty() const
Is this storing anything at all?
TextLineContainer::iterator TextLineIterator
Iterator type for TextLine instances stored by this class.
Integer HighlightStart
The index of the character at the start of the highlight sequence.
Real GetVerticalOffset() const
Gets the vertical adjustment for this character.
ColourValue ActiveHLColour
The colour of the highlight when this layer belongs to a focused widget.
virtual void ProtoSerializeCursor(XML::Node &SelfRoot) const
Convert the TextCursor of this class to an XML::Node ready for seriailization.
virtual const ColourValue & GetActiveHighlightBackgroundColour() const
Gets the colour of the highlight when the quad is being focused.
This represents a single line of text to be rendered by a TextLayer.
Integer HighlightEnd
The index of the character at the end of the highlight sequence.
TextLayer(QuadRenderable *ParentRenderable)
No-Font constructor.
Real AutoCharScaling
The auto-scaling height the text is to be in relative units.
virtual void PopulateTextLines(const Real MaxWidth)
Populates text lines in this layer with parsed characters.
FontData * CharFont
The font this Character belongs to.
std::stringstream StringStream
A Datatype used for streaming operations with strings.
virtual Character * GetCharacterAtOffset(const Vector2 &Offset) const
Gets a Character by offset position.
virtual void RedrawImpl(Boole Force)
Provides the class specific implementation for regenerating vertices for this renderable.
virtual void DestroyAllTextLines()
Destroys all TextLines in this layer.
virtual void SetCursorEnabled(Boole Enable)
Enables (or disables) the cursor for use in this layer.
This is a TextLine specialization class for text read from the right to the left. ...
std::pair< Boole, Integer > CharIndexPair
An std::pair type used as a return for index-offset conversions.
float Real
A Datatype used to represent a real floating point number.
LinearAlignment
Used by various UI classes to determine the alignment of their child objects, such as text in text li...
char Char8
A datatype to represent one character.
Whole GetNumCharacters() const
Gets the number of renderable characters that exist in this string.
There is no auto-scaling applied to text in this layer. Any scaling has to be done explicitly...
Vector2 Scale
The scaling applied to this RenderLayer.
virtual Real GetAutoTextScalar() const
Gets the relative scalar being used to automatically scale text generated by this layer...
This is a TextLine specialization class for text read from the left to the right. ...
virtual Rect GetCursorRect() const
Gets a rect representing this cursors dimentions.
bool SetValue(const Char8 *rhs)
Set the value of this.
void SetAlignment(const UI::LinearAlignment Align)
Sets the current alignment for the text in this line of text.
virtual Integer RemoveCharacterAtIndex(const Integer Index)
Removes a character from the layer at the specified index.
virtual TextLine * GetTextLineAtOffset(const Real &Offset)
Gets the TextLine at the specified offset position.
Whole AsWhole(Whole def=0) const
Attempts to convert the value of the attribute to a Whole and returns the results.
ScalingMode
An enum used to describe how the text generated by this layer will be automatically scaled...
static UIManager * GetSingletonPtr()
Fetches a pointer to the singleton.
Vector2 GetAtlasWhitePixel() const
Gets the coordinates to the white pixel on the atlas this character belongs to.
The provided scaler will be treated as relative to the Screen Y size.
Vector2 GetWhitePixel(const String &Atlas) const
Gets the position of the white pixel from an Atlas.
Real Y
Coordinate on the Y vector.
virtual Integer GetHighlightEnd() const
Gets the index of this last character that is highlighted in this layer.
virtual void RecalculateOffsets()
Recalculates the offset for every text line in this layer.
virtual CharIndexPair GetIndexAtOffset(const Vector2 &Offset)
Gets the index of the character at the specified offset position.
static ColourValue Gray()
Creates a ColourValue representing the colour Gray.
virtual void PopulateTextLinesImpl(const Real MaxWidth)=0
Clears and then places characters belonging to this layer in the appropriate text lines...
virtual TextLine * CreateTextLine()
Creates a new TextLine.
A light-weight handle for manipulating nodes in DOM tree.
This class creates and encapsultes a character that can be used in text renders.
Real X
Coordinate on the X vector.
int AsInt(int def=0) const
Attempts to convert the value of the attribute to an int and returns the results. ...
uint32_t UInt32
An 32-bit unsigned integer.
virtual FontData * GetDefaultFont()
Gets the default font in use by this layer.
This is used to represent a point on a 2 dimentional area, such as a screen.
virtual UInt32 RemoveCharacter(const UInt32 Index)
Removes a single rendered character from this string.
bool Empty() const
Is this storing anything at all?
Real AlphaChannel
Value from 0.0 to 1.0 representing the transparency of the colours. 1.0 is opaque and 0...
CharacterTraits DefaultCharTraits
Default set of traits all characters generated inside this layer are to have.
Boole GetHighlighted() const
Gets if this character is being highlighted.
virtual Real GetMaxLineWidth() const
Gets the maximum width of text lines in this layer.
virtual Vector2 GetActualSize() const
Gets the pixel size of this widget.
virtual Real GetDesiredLineHeight() const
Gets the height in pixels this layer is configured to render it's text.
virtual void Highlight()
Highlights all characters in this layer.
virtual Boole GetCursorEnabled() const
Gets whether or not the Text Cursor is enabled.
virtual MarkupParser * GetMarkupParser() const
Gets the MarkupParser being used by this TextLayer.
Real AsReal(Real def=0) const
Attempts to convert the value of the attribute to a Real and returns the results. ...
virtual const ColourValue & GetInactiveHighlightBackgroundColour() const
Gets the colour of the highlight when the quad is being focused.
virtual CharOffsetPair GetOffsetAtIndexImpl(const Integer Index)=0
Gets the position of the character at the specified index.
CharacterIterator EndCharacter()
Gets an iterator to one passed the last Character.
Class for encapsulating the functionality of the text cursor/carat navigation in text layers...
virtual Integer GetHighlightStart() const
Gets the index of the first character that is highlighted in this layer.
virtual Boole GetVisible() const
Gets the visibility of this cursor.
virtual void SetOffsetPosition(const Vector2 &Offset)
Sets the offset position of this cursor to the nearest appropriate point.
Real GetTexelOffsetX() const
Gets the X axis Texel Offset for the current rendersystem.
virtual void ProtoDeSerializeText(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite the Text of this object with it.
String GetAtlasName() const
Gets the name of the atlas this character is using for rendering.
virtual void SetManualTextScale(const Vector2 &Scale)
Sets the scaling to be applied to the text being rendered.
virtual CharOffsetPair GetOffsetAtIndex(const Integer Index)
Gets the offset position of the character at the provided index.
void SetValues(const Real &x, const Real &y)
Sets the X and Y values of this vector2.
virtual Integer InsertCharactersAtIndex(const Integer Index, const Char8 *Characters, const UInt32 BufSize)
Creates a series of characters from a UTF-8 encoded string to be inserted into this layer...
static String GetSerializableName()
Get the name of the the XML tag the Renderable class will leave behind as its instances are serialize...
const ColourValue & GetCharacterColour() const
Gets the fill colour of this character.
virtual String GetDerivedSerializableName() const
Gets the most derived serializable name of this Renderable.
virtual String GetText() const
Gets the text displayed within this layer.
virtual void ProtoDeSerialize(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite this object with it.
Thrown when the available information should have worked but failed for unknown reasons.
CharacterContainer::iterator CharacterIterator
Iterator type for Character instances stored by this class.
virtual void ClearHighlights()
Clears all the highlights in this layer.
virtual void ProtoDeSerializeProperties(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite the properties of this object with it...
virtual Integer DestroyAllCharacters()
Destroy's all characters in this TextLayer.
virtual TextLayer::ScalingMode GetAutoTextScalingMode() const
Gets the automatic scaling mode being used by this textlayer.
virtual Whole GetNumCharacters() const
Gets the number of characters being rendered by this TextLayer.
virtual void SetTextOrder(const UI::TextOrdering Order)
Sets the ordering for characters in this layer.
virtual const Vector2 & GetManualTextScale() const
Gets the scaling currently being applied to the rendered text.
ColourValue CharColour
The colour to render this Character as.
virtual void SetActiveHighlightBackgroundColour(const ColourValue &Colour)
Sets the colour of the highlight when the quad is being focused.
void ProtoDeSerialize(const XML::Node &OneNode)
Take the data stored in an XML and overwrite this instance of this object with it.
std::pair< String, Real > FontResult
An std::pair type for returning the result of a font suggestion.
virtual void SetTextLineHorizontalAlignment(const UI::LinearAlignment Align)
Sets the horizontal alignment of every textline in this layer.
CharacterContainer::const_iterator ConstCharacterIterator
Const Iterator type for Character instances stored by this class.
virtual void SetTextColour(const ColourValue &Colour)
Sets the default colour of the text being rendered by this layer.
virtual UI::TextOrdering GetTextOrder() const
Gets the currently set direction of advancement for characters on the horizontal axis created by this...
virtual String GetName() const =0
Gets the name of this parser implementation.
void ProtoSerialize(XML::Node &CurrentRoot) const
Convert this class to an XML::Node ready for serialization.
virtual Character * GetCharacterAtIndex(const Integer Index) const
Gets a Character by index.
The bulk of the engine components go in this namspace.
unsigned long Whole
Whole is an unsigned integer, it will be at least 32bits in size.
virtual void ProtoDeSerialize(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite this object with it.
void ProtoSerialize(XML::Node &CurrentRoot) const
Convert this class to an XML::Node ready for serialization.
virtual UInt32 InsertCharacters(const UInt32 Index, const Char8 *Characters, const UInt32 Size)
Inserts multiple characters into this string.
Vector2 ManualCharScaling
The scaling to apply to all characters in this layer.
Boole IsWidget() const
Gets whether or not this renderable is a Widget.
TextLineContainer TextLines
Container with all this layers TextLines.
virtual Integer RemoveCharacterRange(const Integer First, const Integer Last)
Removes a range of characters from the text in this layer.
virtual void DestroyAllTokens()
Destroys all tokens currently in this string.
This is a base class for the parsing of markup texts contained in text layers.
virtual TextCursor * GetCursor() const
Gets the TextCursor in use by this layer.
Boole IsInside(const Vector2 &Point) const
Checks to see if a point in 2D space is inside this rect.
This represents a nestable quad for an object in a GUI layout.
ScalingMode AutoCharScalingMode
The auto-scaling mode that is to be used on text generated by this textlayer.
Vector2 Position
Vector2 representing the top-left position of the rect.
virtual void SetDefaultFont(FontData *NewFont)
Sets the default font to be used with this layer.
virtual void SetText(const String &Text)
Sets the text displayed within this layer.
UI::TextOrdering HorizontalOrder
The order text will have in TextLines.
void SerializeError(const String &FailedTo, const String &ClassName, Boole SOrD)
Simply does some string concatenation, then throws an Exception.
The provided scaler will be treated as relative to the parent widget Y size.
TextLineContainer::const_iterator ConstTextLineIterator
Const Iterator type for TextLine instances stored by this class.
Node AppendChild(NodeType Type=NodeElement)
Creates a Node and makes it a child of this one.
TextCursor * Cursor
The cursor to be used for insert and manipulation operations.
TokenString * TextTokens
The actual text parsed into tokens used for generating characters.
virtual void ProtoDeSerializeCursor(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite the TextCursor of this object with it...
virtual const ColourValue & GetColour() const
Gets the colour that the Text Cursor will be rendered as.
virtual Whole GetNumTextLines() const
Gets the number of TextLines this layer contains.
virtual void ProtoSerializeText(XML::Node &SelfRoot) const
Convert the Text of this class to an XML::Node ready for serialization.
std::string String
A datatype used to a series of characters.
virtual Integer RemoveCharactersAtIndex(const Integer Index, const UInt32 Length)
Removes a length of characters from this layer at the specified index.
virtual void ClearAllTextLines()
Removes all characters from all TextLines belonging to this layer.
virtual String GetRawString() const
Gets a string containing all the raw characters of the tokens in this string.
This is a base class for render layers that render text.
Real GetTexelOffsetY() const
Gets the Y axis Texel Offset for the current rendersystem.
void ProtoDeSerialize(const XML::Node &OneNode)
Take the data stored in an XML and overwrite this instance of this object with it.
UI::MarkupParser * GetMarkupParser(const String &ParserName) const
Gets a MarkupParser by it's registered name.
Attribute GetAttribute(const Char8 *Name) const
Attempt to get an Attribute on this Node with a given name.
virtual void PushVertex(const Real &X, const Real &Y, const Vector2 &UV, const ColourValue &Colour, const String &Atlas)
Collects all the relevant information for a single vertex and pushes it to a vector.
virtual void ProtoSerialize(XML::Node &ParentNode) const
Convert this class to an XML::Node ready for serialization.
Vector2 GetRectCenter() const
Gets the coordinates to the center of this rect.
ColourValue InactiveHLColour
The colour of the highlight when this layer belongs to a widget not being focused.
This is the base class for the types of layers that can be added to a renderable. ...
CharacterContainer::iterator CharacterIterator
Iterator type for Character instances stored by this class.
Node GetChild(const Char8 *Name) const
Attempt to get a child Node with a given name.