Label¶
Inherited: None
Description¶
The Label class is a graphical user interface (GUI) element that is used to display text within the application window. It is a fundamental component in UI design, providing a way to present information, instructions, or labels for other interactive elements like buttons or text fields.
Public Methods¶
int |
align () const |
color () const |
|
cursorAt (int position) |
|
Font * |
font () const |
int |
fontSize () const |
bool |
kerning () const |
void |
setAlign (int alignment) |
void |
setColor (const Vector4 & color) |
void |
setFont (Font * font) |
void |
setFontSize (int size) |
void |
setKerning (const bool enable) |
void |
setText (const TString & text) |
void |
setTranslated (bool enable) |
void |
setWordWrap (bool wrap) |
text () const |
|
bool |
translated () const |
bool |
wordWrap () const |
Static Methods¶
None
Methods Description¶
int Label::align () const
Returns text alignment policy.
See also setAlign().
Vector4 Label::color () const
Returns the color of the text to be drawn.
See also setColor().
Vector2 Label::cursorAt (int position)
Returns a position for virtual cursor.
Font * Label::font () const
Returns the font which will be used to draw a text.
See also setFont().
int Label::fontSize () const
Returns the size of the font.
See also setFontSize().
bool Label::kerning () const
Returns true if glyph kerning enabled; otherwise returns false.
See also setKerning().
void Label::setAlign (int alignment)
Sets text alignment policy.
See also align().
void Label::setColor (Vector4 & color)
Changes the color of the text to be drawn.
See also color().
void Label::setFont (Font * font)
Changes the font which will be used to draw a text.
See also font().
void Label::setFontSize (int size)
Changes the size of the font.
See also fontSize().
void Label::setKerning (bool enable)
Set true to enable glyph kerning and false to disable.
Note: Glyph kerning functionality depends on fonts which you are using. In case of font doesn’t support kerning, you will not see the difference.
See also kerning().
void Label::setText (TString & text)
Changes the text which will be drawn.
See also text().
void Label::setTranslated (bool enable)
Sets enable or disable translation from dictionary for current label.
See also translated().
void Label::setWordWrap (bool wrap)
Sets the word wrap policy. Set true to enable word wrap and false to disable.
See also wordWrap().
TString Label::text () const
Returns the text which will be drawn.
See also setText().
bool Label::translated () const
Returns true if text in label must be translated; othewise returns false.
See also setTranslated().
bool Label::wordWrap () const
Returns true if word wrap enabled; otherwise returns false.
See also setWordWrap().