22 #include "precompiled.h"
45 AddSetting(GUIST_CGUISpriteInstance,
"sprite");
46 AddSetting(GUIST_CGUISpriteInstance,
"sprite_over");
47 AddSetting(GUIST_CGUISpriteInstance,
"sprite_pressed");
48 AddSetting(GUIST_CGUISpriteInstance,
"sprite_disabled");
49 AddSetting(GUIST_CGUISpriteInstance,
"sprite2");
50 AddSetting(GUIST_CGUISpriteInstance,
"sprite2_over");
51 AddSetting(GUIST_CGUISpriteInstance,
"sprite2_pressed");
52 AddSetting(GUIST_CGUISpriteInstance,
"sprite2_disabled");
57 AddSetting(GUIST_CColor,
"textcolor_disabled");
88 float buffer_zone=0.f;
119 glDisable(GL_TEXTURE_2D);
122 float square_side, buffer_zone;
133 CFont font (font_name);
134 float line_height = (float)font.
GetHeight();
144 if (square_side >= line_height)
180 if (square_side > line_height)
181 text_pos.
y += square_side/2.f - line_height/2.f;
const PSRETURN PSRETURN_OK
float left
Returning CPos representing each corner.
static PSRETURN GetSetting(const IGUIObject *pObject, const CStr &Setting, T &Value)
Retrieves a setting by name from object pointer.
void SetupText()
Sets up text, should be called every time changes has been made that can change the visual...
virtual float GetBufferedZ() const
Returns not the Z value, but the actual buffered Z value, i.e.
Includes static functions that needs one template argument.
#define ENSURE(expr)
ensure the expression <expr> evaluates to non-zero.
virtual void HandleMessage(SGUIMessage &Message)
virtual void HandleMessage(SGUIMessage &Message)
void AddSetting(const EGUISettingType &Type, const CStr &Name)
Add a setting to m_Settings.
virtual void Draw()
Draws the control.
CRect m_CachedActualSize
Cached size, real size m_Size is actually dependent on resolution and can have different real outcome...
Made to represent screen positions and delta values.
virtual void DrawText(int index, const CColor &color, const CPos &pos, float z, const CRect &clipping=CRect())
Draws the Text.
static PSRETURN SetSetting(IGUIObject *pObject, const CStr &Setting, const T &Value, const bool &SkipMessage=false)
Sets a value by name using a real datatype as input.
std::vector< SGUIText * > m_GeneratedTexts
Texts that are generated and ready to be rendered.
Message send to IGUIObject::HandleMessage() in order to give life to Objects manually with a derived ...
EGUIMessageType type
Describes what the message regards.
void AddText(SGUIText *text)
Adds a text object.
String class, substitute for CStr, but that parses the tags and builds up a list of all text that wil...
SGUIText GenerateText(const CGUIString &Text, const CStrW &Font, const float &Width, const float &BufferZone, const IGUIObject *pObject=NULL)
Generate a SGUIText object from the inputted string.
static PSRETURN GetSettingPointer(const IGUIObject *pObject, const CStr &Setting, T *&Value)
An SGUIText object is a parsed string, divided into text-rendering components.
Rectangle class used for screen rectangles.