41 #ifndef _uicharactertraits_cpp
42 #define _uicharactertraits_cpp
44 #include "UI/charactertraits.h"
46 #include "UI/textureatlas.h"
48 #include "UI/uimanager.h"
115 String FontName, AtlasName;
118 if( !CurrAttrib.
Empty() )
122 if( !CurrAttrib.
Empty() )
125 if( !FontName.empty() && !AtlasName.empty() ) {
132 if( !CharColourNode.
Empty() )
144 return "CharacterTraits";
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.
void ProtoDeSerialize(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite this object with it.
A light-weight handle for manipulating attributes in DOM tree.
virtual ~CharacterTraits()
Class Destructor.
const String & GetAtlasName() const
Gets the name of the TextureAtlas this font belongs to.
bool Boole
Generally acts a single bit, true or false.
void ProtoSerialize(XML::Node &ParentNode) const
Convert this class to an XML::Node ready for serialization.
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.
Thrown when a version is accessed/parsed/required and it cannot work correctly or is missing...
CharacterTraits()
Blank Constructor.
const Char8 * AsString(const Char8 *def="") const
Attempts to convert the value of the attribute to a String and returns the results.
This is a simple class for holding 4 reals representing the colour any give object or lightsource can...
bool Empty() const
Is this storing anything at all?
This class stores common data for determining the look of a Character.
FontData * CharFont
The font this Character belongs to.
bool SetValue(const Char8 *rhs)
Set the value of this.
static UIManager * GetSingletonPtr()
Fetches a pointer to the singleton.
A light-weight handle for manipulating nodes in DOM tree.
This class creates and encapsultes a character that can be used in text renders.
int AsInt(int def=0) const
Attempts to convert the value of the attribute to an int and returns the results. ...
Boole operator!=(const CharacterTraits &Other) const
Inequality comparison operator.
const String & GetName() const
Gets the name of this font.
bool Empty() const
Is this storing anything at all?
Boole operator==(const CharacterTraits &Other) const
Equality comparison operator.
CharacterTraits & operator=(const CharacterTraits &Other)
Assignment operator.
ColourValue CharColour
The colour to render this Character as.
void ProtoDeSerialize(const XML::Node &OneNode)
Take the data stored in an XML and overwrite this instance of this object with it.
static String GetSerializableName()
Get the name of the the XML tag this class will leave behind as its instances are serialized...
Thrown when the identity string wasn't valid at all.
The bulk of the engine components go in this namspace.
void ProtoSerialize(XML::Node &CurrentRoot) const
Convert this class to an XML::Node ready for serialization.
const Char8 * Name() const
ptrdiff_tGet the name of this Node.
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.
Attribute GetAttribute(const Char8 *Name) const
Attempt to get an Attribute on this Node with a given name.
Node GetChild(const Char8 *Name) const
Attempt to get a child Node with a given name.