20 #include "precompiled.h"
33 AddSetting(GUIST_CGUISpriteInstance,
"sprite");
75 float buffer_zone = 0.f;
81 float max_width = 0.f;
89 CPos mousepos, offset;
104 float textwidth = std::min(
m_GeneratedTexts[0]->m_Size.cx, (
float)max_width);
121 size.
pixel.
top = mousepos.
y + offset.
y - textheight/2.f;
132 float screenw = (float)g_xres, screenh = (
float)
g_yres;
void DrawSprite(const CGUISpriteInstance &Sprite, int CellID, const float &Z, const CRect &Rect, const CRect &Clipping=CRect())
Draw GUI Sprite.
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.
CRect pixel
Pixel modifiers.
Includes static functions that needs one template argument.
#define ENSURE(expr)
ensure the expression <expr> evaluates to non-zero.
virtual void HandleMessage(SGUIMessage &Message)
void AddSetting(const EGUISettingType &Type, const CStr &Name)
Add a setting to m_Settings.
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.
CPos GetMousePos() const
Get Mouse from CGUI.
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.
#define debug_warn(expr)
display the error dialog with the given text.
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 ...
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.
bool m_GeneratedTextsValid
Whether the cached text is currently valid (if not then SetupText will be called by Draw) ...
CPos TopLeft() const
Get Position equivalent to top/left corner.
static PSRETURN GetSettingPointer(const IGUIObject *pObject, const CStr &Setting, T *&Value)
An SGUIText object is a parsed string, divided into text-rendering components.
Client Area is a rectangle relative to a parent rectangle.