LabelΒΆ

Inherited: Widget

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

bool

clip () const

Vector4

color () const

Font *

font () const

int

fontSize () const

bool

kerning () const

void

setAlign (int alignment)

void

setClip (bool enable)

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)

TString

text () const

float

textWidth () const

bool

translated () const

bool

wordWrap () const

Static MethodsΒΆ

None

Methods DescriptionΒΆ

int Label::align () const

Returns text alignment policy.

See also setAlign().


bool Label::clip () const

Returns true if clip mode is enabled; otherwise returns false.

See also setClip().


Vector4 Label::color () const

Returns the color of the text to be drawn.

See also setColor().


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::setClip (bool enable)

Sets enable or disable clipping of contents to the label bounds.

See also clip().


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().


float Label::textWidth () const

Returns a space that text requires to render.


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().