.. _api_Label: Label ===== Inherited: :ref:`Widget` .. _api_Label_description: 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. .. _api_Label_public: Public Methods -------------- +------------------------------+-------------------------------------------------------------+ | int | :ref:`align` () const | +------------------------------+-------------------------------------------------------------+ | bool | :ref:`clip` () const | +------------------------------+-------------------------------------------------------------+ | :ref:`Vector4` | :ref:`color` () const | +------------------------------+-------------------------------------------------------------+ | :ref:`Font` * | :ref:`font` () const | +------------------------------+-------------------------------------------------------------+ | int | :ref:`fontSize` () const | +------------------------------+-------------------------------------------------------------+ | bool | :ref:`kerning` () const | +------------------------------+-------------------------------------------------------------+ | void | :ref:`setAlign` (int alignment) | +------------------------------+-------------------------------------------------------------+ | void | :ref:`setClip` (bool enable) | +------------------------------+-------------------------------------------------------------+ | void | :ref:`setColor` (const Vector4 & color) | +------------------------------+-------------------------------------------------------------+ | void | :ref:`setFont` (Font * font) | +------------------------------+-------------------------------------------------------------+ | void | :ref:`setFontSize` (int size) | +------------------------------+-------------------------------------------------------------+ | void | :ref:`setKerning` (const bool enable) | +------------------------------+-------------------------------------------------------------+ | void | :ref:`setText` (const TString & text) | +------------------------------+-------------------------------------------------------------+ | void | :ref:`setTranslated` (bool enable) | +------------------------------+-------------------------------------------------------------+ | void | :ref:`setWordWrap` (bool wrap) | +------------------------------+-------------------------------------------------------------+ | :ref:`TString` | :ref:`text` () const | +------------------------------+-------------------------------------------------------------+ | float | :ref:`textWidth` () const | +------------------------------+-------------------------------------------------------------+ | bool | :ref:`translated` () const | +------------------------------+-------------------------------------------------------------+ | bool | :ref:`wordWrap` () const | +------------------------------+-------------------------------------------------------------+ .. _api_Label_static: Static Methods -------------- None .. _api_Label_methods: Methods Description ------------------- .. _api_Label_84dae9fb: int **Label::align** () const Returns text alignment policy. **See also** setAlign(). ---- .. _api_Label_15069fba: bool **Label::clip** () const Returns true if clip mode is enabled; otherwise returns false. **See also** setClip(). ---- .. _api_Label_07456f13: :ref:`Vector4` **Label::color** () const Returns the color of the text to be drawn. **See also** setColor(). ---- .. _api_Label_fa1279c4: :ref:`Font` * **Label::font** () const Returns the font which will be used to draw a text. **See also** setFont(). ---- .. _api_Label_b6a137d2: int **Label::fontSize** () const Returns the size of the font. **See also** setFontSize(). ---- .. _api_Label_b3d406ce: bool **Label::kerning** () const Returns true if glyph kerning enabled; otherwise returns false. **See also** setKerning(). ---- .. _api_Label_0deb1a73: void **Label::setAlign** (int *alignment*) Sets text *alignment* policy. **See also** align(). ---- .. _api_Label_d08953fc: void **Label::setClip** (bool *enable*) Sets *enable* or disable clipping of contents to the label bounds. **See also** clip(). ---- .. _api_Label_3ac540d2: void **Label::setColor** (:ref:`Vector4` & *color*) Changes the *color* of the text to be drawn. **See also** color(). ---- .. _api_Label_21b6e9c8: void **Label::setFont** (:ref:`Font` * *font*) Changes the *font* which will be used to draw a text. **See also** font(). ---- .. _api_Label_e6fcba39: void **Label::setFontSize** (int *size*) Changes the *size* of the font. **See also** fontSize(). ---- .. _api_Label_4ae319bc: 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(). ---- .. _api_Label_826c4b3a: void **Label::setText** (:ref:`TString` & *text*) Changes the *text* which will be drawn. **See also** text(). ---- .. _api_Label_adf082ec: void **Label::setTranslated** (bool *enable*) Sets *enable* or disable translation from dictionary for current label. **See also** translated(). ---- .. _api_Label_fe8ba625: void **Label::setWordWrap** (bool *wrap*) Sets the word *wrap* policy. Set true to enable word *wrap* and false to disable. **See also** wordWrap(). ---- .. _api_Label_f9150ac2: :ref:`TString` **Label::text** () const Returns the text which will be drawn. **See also** setText(). ---- .. _api_Label_cf7e65a4: float **Label::textWidth** () const Returns a space that text requires to render. ---- .. _api_Label_192dba47: bool **Label::translated** () const Returns true if text in label must be translated; othewise returns false. **See also** setTranslated(). ---- .. _api_Label_538fe7cd: bool **Label::wordWrap** () const Returns true if word wrap enabled; otherwise returns false. **See also** setWordWrap().