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

Vector4

color () const

Vector2

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 kerning)

void

setText (const std::string text)

void

setWordWrap (bool wrap)

std::string

text () 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 kerning)

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 (std::string text)

Changes the text which will be drawn.

See also *text*().


void Label::setWordWrap (bool wrap)

Sets the word wrap policy. Set true to enable word wrap and false to disable.

See also wordWrap().


std::string Label::text () const

Returns the text which will be drawn.

See also setText().


bool Label::wordWrap () const

Returns true if word wrap enabled; otherwise returns false.

See also setWordWrap().