40 #ifndef _uirenderlayer_cpp
41 #define _uirenderlayer_cpp
43 #include "UI/renderlayer.h"
44 #include "UI/quadrenderable.h"
45 #include "UI/screen.h"
46 #include "MathTools/mathtools.h"
53 Parent(ParentRenderable),
71 Point -= RotationCenter;
74 Point.
X = Copy.
X * RotCos - Copy.
Y * RotSin;
75 Point.
Y = Copy.
X * RotSin + Copy.
Y * RotCos;
77 Point += RotationCenter;
84 Vector2 RotCenter( TopLeft.
X + ( ( BottomRight.
X - TopLeft.
X ) * 0.5 ), TopLeft.
Y + ( ( BottomRight.
Y - TopLeft.
Y ) * 0.5 ) );
105 Vector2 RotCenter( RotRect[UI::QC_TopLeft].X + ( ( RotRect[UI::QC_BottomRight].X - RotRect[UI::QC_TopLeft].X ) * 0.5 ),
106 RotRect[UI::QC_TopLeft].Y + ( ( RotRect[UI::QC_BottomRight].Y - RotRect[UI::QC_TopLeft].Y ) * 0.5 ) );
153 if( this->
Scale == Scaling )
156 this->
Scale = Scaling;
191 this->
RotAngle = MathTools::DegreesToRadians(Degrees);
202 {
return MathTools::RadiansToDegrees(
RotAngle); }
242 if( !PropertiesNode.
Empty() ) {
245 if( !CurrAttrib.
Empty() )
249 if( !ScaleNode.
Empty() )
266 return "RenderLayer";
static String GetSerializableName()
Get the name of the the XML tag the Renderable class will leave behind as its instances are serialize...
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 Boole IsMultiLineTextLayer() const
Gets whether or not this is a MultiLineTextLayer.
Attribute AppendAttribute(const Char8 *Name)
Creates an Attribute and puts it at the end of this Nodes attributes.
A light-weight handle for manipulating attributes in DOM tree.
virtual Boole IsLineLayer() const
Gets whether or not this is an LineLayer.
virtual void NotifyActive()
Notifies this RenderLayer that the group this layer belongs to has become the active group...
bool Boole
Generally acts a single bit, true or false.
virtual Vector2 GetScale() const
Gets the scaling currently applied to this render layer.
virtual void RotationTransform(Vector2 &Point, const Vector2 &RotationCenter)
Applies rotation to a point in 2D space.
virtual Rect GetAreaRect() const
Gets a rect containing the actual position and size of this layer.
virtual Boole IsSingleImageLayer() const
Gets whether or not this is a SingleImageLayer.
virtual Whole GetIndex() const
Gets the index position of this RenderLayer in it's parent.
Thrown when the requested identity could not be found.
virtual QuadRenderable * GetParent() const
Gets the parent of this render layer.
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.
QuadRenderable * Parent
A pointer to the parent of this RenderLayer.
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.
virtual Boole IsSingleLineTextLayer() const
Gets whether or not this is a SingleLineTextLayer.
Rect & ApplyScaling(const Vector2 &Scaling)
Scales this rect.
Thrown when a version is accessed/parsed/required and it cannot work correctly or is missing...
Value representing a SingleLineTextLayer.
virtual void _UpdateIndex(const Whole Index)
Notifies this RenderLayer that it's index in the parent QuadRenderable has been updated.
Screen * GetScreen() const
Gets the parent screen of this renderable.
This class represents a box shaped area on the screen.
virtual Screen * GetScreen() const
Gets the screen the parent renderable is being rendered on.
virtual Real GetRotationRadians() const
Gets the current rotation applied to this renderable in radians.
virtual void RotationTransform(Vector2 &TopLeft, Vector2 &TopRight, Vector2 &BottomLeft, Vector2 &BottomRight, const Vector2 &RotationCenter)
Applies rotation to a quad in 2D space.
virtual void _MarkDirty()
Marks this renderable as well as all parent objects as dirty.
bool Empty() const
Is this storing anything at all?
Value representing a MultiLineTextLayer.
float Real
A Datatype used to represent a real floating point number.
Vector2 Scale
The scaling applied to this RenderLayer.
bool SetValue(const Char8 *rhs)
Set the value of this.
Value representing a SingleImageLayer.
Real Y
Coordinate on the Y vector.
virtual Real GetRotationDegrees() const
Gets the current rotation applied to this renderable in degrees.
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. ...
Boole Dirty
This determines whether or not the vertices in this renderer need to be refreshed.
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?
virtual Vector2 GetActualSize() const
Gets the pixel size of this widget.
virtual void SetRotationDegrees(const Real &Degrees)
Sets the rotation to be applied to this renderable.
Real AsReal(Real def=0) const
Attempts to convert the value of the attribute to a Real and returns the results. ...
virtual Boole IsMultiImageLayer() const
Gets whether or not this is a MultiImageLayer.
virtual void ProtoDeSerializeProperties(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite the properties of this object with it...
void SetValues(const Real &x, const Real &y)
Sets the X and Y values of this vector2.
virtual String GetDerivedSerializableName() const
Gets the most derived serializable name of this Renderable.
virtual void RotationTransform(Vector2 &TopLeft, Vector2 &TopRight, Vector2 &BottomLeft, Vector2 &BottomRight)
Applies rotation to a quad in 2D space.
virtual Boole IsTextLayer() const
Gets whether or not this is a TextLayer.
virtual Boole IsImageLayer() const
Gets whether or not this is an ImageLayer.
virtual void NotifyInactive()
Notifies this RenderLayer that the group this layer belongs to is no longer the active group...
virtual String GetPrimaryAtlas()
Gets the currently set primary atlas.
virtual void SetScale(const Vector2 &Scaling)
Sets the scaling to be applied to this render layer.
RenderLayer(QuadRenderable *ParentRenderable)
Class constructor.
void ProtoSerialize(XML::Node &CurrentRoot) const
Convert this class to an XML::Node ready for serialization.
The bulk of the engine components go in this namspace.
virtual void SetRotationRadians(const Real &Radians)
Sets the rotation to be applied to this renderable.
Value representing a LineLayer.
unsigned long Whole
Whole is an unsigned integer, it will be at least 32bits in size.
virtual Vector2 GetActualPosition() const
Gets the pixel position of this widget.
This represents a nestable quad for an object in a GUI layout.
virtual void _MarkDirty()
Marks this renderable as dirty, and informs other renderables if needed.
virtual void ProtoSerializeProperties(XML::Node &SelfRoot) const
Convert the properties of this class to an XML::Node ready for serialization.
virtual ~RenderLayer()
Class destructor.
void SerializeError(const String &FailedTo, const String &ClassName, Boole SOrD)
Simply does some string concatenation, then throws an Exception.
virtual UI::RenderLayerType GetLayerType() const =0
Gets the type of render layer this is.
Node AppendChild(NodeType Type=NodeElement)
Creates a Node and makes it a child of this one.
This class is a helper class for creating UI's. It is responsible for storing and keeping track of al...
Value representing a MultiImageLayer.
std::string String
A datatype used to a series of characters.
void ProtoDeSerialize(const XML::Node &OneNode)
Take the data stored in an XML and overwrite this instance of this object with it.
Attribute GetAttribute(const Char8 *Name) const
Attempt to get an Attribute on this Node with a given name.
Whole IndexID
Stores the index of this RenderLayer in it's parent QuadRenderable.
Node GetChild(const Char8 *Name) const
Attempt to get a child Node with a given name.
Real RotAngle
The amount of rotation to be applied to this RenderLayer in radians.