40 #ifndef _uisinglelinetextlayer_cpp
41 #define _uisinglelinetextlayer_cpp
43 #include "UI/singlelinetextlayer.h"
44 #include "UI/quadrenderable.h"
45 #include "UI/screen.h"
47 #include "UI/textline.h"
48 #include "UI/character.h"
49 #include "UI/uimanager.h"
50 #include "MathTools/mathtools.h"
169 if( !PropertiesNode.
Empty() ) {
172 if( !CurrAttrib.
Empty() )
186 {
return "SingleLineTextLayer"; }
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.
Attribute AppendAttribute(const Char8 *Name)
Creates an Attribute and puts it at the end of this Nodes attributes.
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.
Real GetPositionOffset() const
Gets the offset on the Y axis from the parent layer.
virtual ~SingleLineTextLayer()
Class destructor.
CharacterContainer Characters
Container with all this layers Characters.
Thrown when the requested identity could not be found.
UInt32 GetNumCharacters() const
Gets the number of characters in this TextLine.
#define MEZZ_EXCEPTION(num, desc)
An easy way to throw exceptions with rich information.
int Integer
A datatype used to represent any integer close to.
virtual void VerticallyAlign(const UI::LinearAlignment Align)
Aligns the text of the caption on the Y axis.
Thrown when a version is accessed/parsed/required and it cannot work correctly or is missing...
virtual CharIndexPair GetIndexAtOffsetImpl(const Vector2 &Offset)
Gets the index of the character at the specified offset position.
Value representing a SingleLineTextLayer.
virtual void SetStartIndex(const Integer &Index)
Sets the index from the beginning at which characters will start to be rendered.
Real GetOffsetAtIndex(const Integer &Index) const
Gets the Offset position of the character at the specified index.
static String GetSerializableName()
Get the name of the the XML tag the Renderable class will leave behind as its instances are serialize...
virtual void ProtoSerializeProperties(XML::Node &SelfRoot) const
Convert the properties of this class to an XML::Node ready for serialization.
SingleLineTextLayer(QuadRenderable *ParentRenderable)
No-Font constructor.
bool Empty() const
Is this storing anything at all?
This represents a single line of text to be rendered by a TextLayer.
virtual UI::RenderLayerType GetLayerType() const
Gets the type of render layer this is.
virtual Integer GetStartIndex() const
Gets the set index for the character that's at the start of the characters being rendered.
Boole AppendCharacter(Character *ToAdd, const Real MaxWidth)
Adds a Character to the end of this TextLine.
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...
Characters/New Lines originate from the right, and advance to the left.
CharacterContainer::reverse_iterator ReverseCharacterIterator
Reverse Iterator type for Character instances stored by this class.
bool SetValue(const Char8 *rhs)
Set the value of this.
virtual CharOffsetPair GetOffsetAtIndexImpl(const Integer Index)
Gets the offset position of the character at the provided index.
Real Y
Coordinate on the Y vector.
Integer GetIndexAtOffset(const Real &Offset) const
Gets the index of the character at the provided offset.
A light-weight handle for manipulating nodes in DOM tree.
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. ...
This is used to represent a point on a 2 dimentional area, such as a screen.
bool Empty() const
Is this storing anything at all?
Real GetLineHeight() const
Gets the size of this TextLine on the Y axis.
virtual void HorizontallyAlign(const UI::LinearAlignment Align)
Aligns the text of the caption on the X axis.
virtual String GetDerivedSerializableName() const
Gets the most derived serializable name of this Renderable.
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 TextLine * GetLine() const
Gets a pointer to the only textline in this layer.
virtual void SetTextLineHorizontalAlignment(const UI::LinearAlignment Align)
Sets the horizontal alignment of every textline in this layer.
Integer StartIndex
The index at which this text layer will start rendering characters.
RenderLayerType
This enum describes the type of RenderLayer this is for use in casting.
The bulk of the engine components go in this namspace.
virtual void PopulateTextLinesImpl(const Real MaxWidth)
Clears and then places characters belonging to this layer in the appropriate text lines...
virtual void ProtoDeSerializeProperties(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite the properties of this object with it...
TextLineContainer TextLines
Container with all this layers TextLines.
This represents a nestable quad for an object in a GUI layout.
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.
Node AppendChild(NodeType Type=NodeElement)
Creates a Node and makes it a child of this one.
std::string String
A datatype used to a series of characters.
This is a base class for render layers that render text.
Attribute GetAttribute(const Char8 *Name) const
Attempt to get an Attribute on this Node with a given name.
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.