9#include "IGUIStaticText.h"
18#include <IGUIEnvironment.h>
36 IGUIElement* parent, s32
id,
const core::rect<s32>& rectangle,
37 bool background =
false);
42 static irr::gui::IGUIStaticText *
add(
43 irr::gui::IGUIEnvironment *
guienv,
45 const core::rect< s32 > &rectangle,
48 irr::gui::IGUIElement *parent = NULL,
50 bool fillBackground =
false)
52 parent = parent ? parent :
guienv->getRootGUIElement();
54 text, border,
guienv, parent,
55 id, rectangle, fillBackground);
57 result->setWordWrap(wordWrap);
62 static irr::gui::IGUIStaticText *
add(
63 irr::gui::IGUIEnvironment *
guienv,
64 std::wstring_view text,
65 const core::rect< s32 > &rectangle,
68 irr::gui::IGUIElement *parent = NULL,
70 bool fillBackground =
false)
110 virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical);
139 virtual void setText(
const wchar_t* text);
161 virtual bool hasType(EGUI_ELEMENT_TYPE t)
const {
203 static_text->setText(text.
c_str());
207inline void setStaticText(irr::gui::IGUIStaticText *static_text, std::wstring_view text)
Definition enriched_string.h:29
const wchar_t * c_str() const
Definition enriched_string.h:61
Definition static_text.h:30
virtual void setWordWrap(bool enable)
Enables or disables word wrap for using the static text as multiline text control.
Definition static_text.cpp:261
virtual bool isWordWrapEnabled() const
Checks if word wrap is enabled.
Definition static_text.cpp:268
std::vector< EnrichedString > BrokenText
Definition static_text.h:187
virtual IGUIFont * getOverrideFont() const
Gets the override font (if any)
Definition static_text.cpp:146
gui::IGUIFont * OverrideFont
Definition static_text.h:183
virtual bool isOverrideColorEnabled() const
Checks if an override color is enabled.
Definition static_text.cpp:253
virtual bool hasType(EGUI_ELEMENT_TYPE t)
Definition static_text.h:165
virtual void setRightToLeft(bool rtl)
Set whether the string should be interpreted as right-to-left (RTL) text.
Definition static_text.cpp:274
StaticText(const EnrichedString &text, bool border, IGUIEnvironment *environment, IGUIElement *parent, s32 id, const core::rect< s32 > &rectangle, bool background=false)
constructor
Definition static_text.cpp:23
virtual video::SColor getBackgroundColor() const
Gets the background color.
Definition static_text.cpp:186
virtual void setTextRestrainedInside(bool restrainedInside)
Set whether the text in this label should be clipped if it goes outside bounds.
Definition static_text.cpp:216
bool WordWrap
Definition static_text.h:178
bool RightToLeft
Definition static_text.h:181
virtual bool hasType(EGUI_ELEMENT_TYPE t) const
Definition static_text.h:161
static irr::gui::IGUIStaticText * add(irr::gui::IGUIEnvironment *guienv, std::wstring_view text, const core::rect< s32 > &rectangle, bool border=false, bool wordWrap=true, irr::gui::IGUIElement *parent=NULL, s32 id=-1, bool fillBackground=false)
Definition static_text.h:62
virtual bool isTextRestrainedInside() const
Checks if the text in this label should be clipped if it goes outside bounds.
Definition static_text.cpp:222
virtual video::SColor getOverrideColor() const
Gets the override color.
Definition static_text.cpp:235
bool Border
Definition static_text.h:177
gui::IGUIFont * LastBreakFont
Definition static_text.h:184
virtual IGUIFont * getActiveFont() const
Get the font which is used right now for drawing.
Definition static_text.cpp:152
virtual void setDrawBorder(bool draw)
Sets whether to draw the border.
Definition static_text.cpp:203
virtual void setOverrideColor(video::SColor color)
Sets another color for the text.
Definition static_text.cpp:163
EGUI_ALIGNMENT HAlign
Definition static_text.h:176
virtual s32 getTextHeight() const
Returns the height of the text in pixels when it is drawn.
Definition static_text.cpp:546
EGUI_ALIGNMENT VAlign
Definition static_text.h:176
bool RestrainTextInside
Definition static_text.h:180
virtual video::SColor getActiveColor() const
Gets the currently used text color.
Definition static_text.cpp:240
virtual bool isRightToLeft() const
Checks if the text should be interpreted as right-to-left text.
Definition static_text.cpp:284
virtual void updateAbsolutePosition()
Updates the absolute position, splits text if word wrap is enabled.
Definition static_text.cpp:538
virtual void enableOverrideColor(bool enable)
Sets if the static text should use the overide color or the color in the gui skin.
Definition static_text.cpp:247
virtual bool isDrawBorderEnabled() const
Checks if border drawing is enabled.
Definition static_text.cpp:210
void updateText()
Breaks the single text line.
Definition static_text.cpp:292
virtual void setDrawBackground(bool draw)
Sets whether to draw the background.
Definition static_text.cpp:179
virtual void draw()
draws the element and its children
Definition static_text.cpp:49
virtual void setBackgroundColor(video::SColor color)
Sets another color for the background.
Definition static_text.cpp:171
virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical)
Sets alignment mode for text.
Definition static_text.cpp:228
virtual ~StaticText()
destructor
Definition static_text.cpp:42
bool Background
Definition static_text.h:179
static irr::gui::IGUIStaticText * add(irr::gui::IGUIEnvironment *guienv, const EnrichedString &text, const core::rect< s32 > &rectangle, bool border=false, bool wordWrap=true, irr::gui::IGUIElement *parent=NULL, s32 id=-1, bool fillBackground=false)
Definition static_text.h:42
virtual void setText(const wchar_t *text)
Sets the new caption of this element.
Definition static_text.cpp:526
virtual bool isDrawBackgroundEnabled() const
Checks if background drawing is enabled.
Definition static_text.cpp:196
EnrichedString ColoredText
Definition static_text.h:186
virtual void setOverrideFont(IGUIFont *font=0)
Sets another skin independent font.
Definition static_text.cpp:129
virtual s32 getTextWidth() const
Returns the width of the current text, in the current font.
Definition static_text.cpp:561
gui::IGUIEnvironment * guienv
Definition clientlauncher.cpp:34
const EGUI_ELEMENT_TYPE EGUIET_ENRICHED_STATIC_TEXT
Definition static_text.h:27
Definition clientmap.h:30
void setStaticText(irr::gui::IGUIStaticText *static_text, const EnrichedString &text)
Definition static_text.h:195