Irrlicht 3D Engine: irr::gui::IGUIStaticText Class Reference

| Irrlicht 3D Engine |

Public Member Functions
irr::gui::IGUIStaticText Class Reference

Multi or single line text label. More...

`#include <IGUIStaticText.h>`

Inheritance diagram for irr::gui::IGUIStaticText:

List of all members.

## Public Member Functions

- IGUIStaticText (IGUIEnvironment *environment, IGUIElement *parent, s32 id, core::rect< s32 > rectangle)
    constructor
- virtual void enableOverrideColor (bool enable)=0
    Sets if the static text should use the overide color or the color in the gui skin.
- virtual IGUIFont * getActiveFont () const =0
    Get the font which is used right now for drawing.
- virtual video::SColor getBackgroundColor () const =0
    Gets the background color.
- virtual video::SColor getOverrideColor (void) const =0
    Gets the override color.
- virtual IGUIFont * getOverrideFont (void) const =0
    Gets the override font (if any)
- virtual s32 getTextHeight () const =0
    Returns the height of the text in pixels when it is drawn.
- virtual s32 getTextWidth (void) const =0
    Returns the width of the current text, in the current font.
- virtual bool isDrawBackgroundEnabled () const =0
    Checks if background drawing is enabled.
- virtual bool isDrawBorderEnabled () const =0
    Checks if border drawing is enabled.
- virtual bool isOverrideColorEnabled (void) const =0
    Checks if an override color is enabled.
- virtual bool isRightToLeft () const =0
    Checks whether the text in this element should be interpreted as right-to-left.
- virtual bool isTextRestrainedInside () const =0
    Checks if the text in this label should be clipped if it goes outside bounds.
- virtual bool isWordWrapEnabled (void) const =0
    Checks if word wrap is enabled.
- virtual void setBackgroundColor (video::SColor color)=0
    Sets another color for the background.
- virtual void setDrawBackground (bool draw)=0
    Sets whether to draw the background.
- virtual void setDrawBorder (bool draw)=0
    Sets whether to draw the border.
- virtual void setOverrideColor (video::SColor color)=0
    Sets another color for the text.
- virtual void setOverrideFont (IGUIFont *font=0)=0
    Sets another skin independent font.
- virtual void setRightToLeft (bool rtl)=0
    Set whether the string should be interpreted as right-to-left (RTL) text.
- virtual void setTextAlignment (EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical)=0
    Sets text justification mode.
- virtual void setTextRestrainedInside (bool restrainedInside)=0
    Set whether the text in this label should be clipped if it goes outside bounds.
- virtual void setWordWrap (bool enable)=0
    Enables or disables word wrap for using the static text as multiline text control.

## Detailed Description

Multi or single line text label.

Definition at line 18 of file IGUIStaticText.h.

## Constructor & Destructor Documentation

irr::gui::IGUIStaticText::IGUIStaticText | ( | IGUIEnvironment * | environment,
|  | IGUIElement * | parent,
|  | s32 | id,
|  | core::rect< s32 > | rectangle
| ) |  | `[inline]`

constructor

Definition at line 23 of file IGUIStaticText.h.

## Member Function Documentation

virtual void irr::gui::IGUIStaticText::enableOverrideColor | ( | bool | enable | ) | `[pure virtual]`

Sets if the static text should use the overide color or the color in the gui skin.

Parameters:

  enable,: | If set to true, the override color, which can be set with IGUIStaticText::setOverrideColor is used, otherwise the EGDC_BUTTON_TEXT color of the skin.

virtual IGUIFont* irr::gui::IGUIStaticText::getActiveFont | ( |  | ) | const`[pure virtual]`

Get the font which is used right now for drawing.

Currently this is the override font when one is set and the font of the active skin otherwise

virtual video::SColor irr::gui::IGUIStaticText::getBackgroundColor | ( |  | ) | const`[pure virtual]`

Gets the background color.

Returns:
  : The background color

virtual video::SColor irr::gui::IGUIStaticText::getOverrideColor | ( | void |  | ) | const`[pure virtual]`

Gets the override color.

Returns:
  : The override color

virtual IGUIFont* irr::gui::IGUIStaticText::getOverrideFont | ( | void |  | ) | const`[pure virtual]`

Gets the override font (if any)

Returns:
  The override font (may be 0)

virtual s32 irr::gui::IGUIStaticText::getTextHeight | ( |  | ) | const`[pure virtual]`

Returns the height of the text in pixels when it is drawn.

This is useful for adjusting the layout of gui elements based on the height of the multiline text in this element.

Returns:
  Height of text in pixels.

virtual s32 irr::gui::IGUIStaticText::getTextWidth | ( | void |  | ) | const`[pure virtual]`

Returns the width of the current text, in the current font.

If the text is broken, this returns the width of the widest line

Returns:
  The width of the text, or the widest broken line.

virtual bool irr::gui::IGUIStaticText::isDrawBackgroundEnabled | ( |  | ) | const`[pure virtual]`

Checks if background drawing is enabled.

Returns:
  true if background drawing is enabled, false otherwise

virtual bool irr::gui::IGUIStaticText::isDrawBorderEnabled | ( |  | ) | const`[pure virtual]`

Checks if border drawing is enabled.

Returns:
  true if border drawing is enabled, false otherwise

virtual bool irr::gui::IGUIStaticText::isOverrideColorEnabled | ( | void |  | ) | const`[pure virtual]`

Checks if an override color is enabled.

Returns:
  true if the override color is enabled, false otherwise

virtual bool irr::gui::IGUIStaticText::isRightToLeft | ( |  | ) | const`[pure virtual]`

Checks whether the text in this element should be interpreted as right-to-left.

virtual bool irr::gui::IGUIStaticText::isTextRestrainedInside | ( |  | ) | const`[pure virtual]`

Checks if the text in this label should be clipped if it goes outside bounds.

virtual bool irr::gui::IGUIStaticText::isWordWrapEnabled | ( | void |  | ) | const`[pure virtual]`

Checks if word wrap is enabled.

Returns:
  true if word wrap is enabled, false otherwise

virtual void irr::gui::IGUIStaticText::setBackgroundColor | ( | video::SColor | color | ) | `[pure virtual]`

Sets another color for the background.

virtual void irr::gui::IGUIStaticText::setDrawBackground | ( | bool | draw | ) | `[pure virtual]`

Sets whether to draw the background.

virtual void irr::gui::IGUIStaticText::setDrawBorder | ( | bool | draw | ) | `[pure virtual]`

Sets whether to draw the border.

virtual void irr::gui::IGUIStaticText::setOverrideColor | ( | video::SColor | color | ) | `[pure virtual]`

Sets another color for the text.

If set, the static text does not use the EGDC_BUTTON_TEXT color defined in the skin, but the set color instead. You don't need to call IGUIStaticText::enableOverrrideColor(true) after this, this is done by this function. If you set a color, and you want the text displayed with the color of the skin again, call IGUIStaticText::enableOverrideColor(false);

Parameters:

  color,: | New color of the text.

virtual void irr::gui::IGUIStaticText::setOverrideFont | ( | IGUIFont * | font = `0` | ) | `[pure virtual]`

Sets another skin independent font.

If this is set to zero, the button uses the font of the skin.

Parameters:

  font,: | New font to set.

virtual void irr::gui::IGUIStaticText::setRightToLeft | ( | bool | rtl | ) | `[pure virtual]`

Set whether the string should be interpreted as right-to-left (RTL) text.

Note:
  This component does not implement the Unicode bidi standard, the text of the component should be already RTL if you call this. The main difference when RTL is enabled is that the linebreaks for multiline elements are performed starting from the end.

virtual void irr::gui::IGUIStaticText::setTextAlignment | ( | EGUI_ALIGNMENT | horizontal,
|  | EGUI_ALIGNMENT | vertical
| ) |  | `[pure virtual]`

Sets text justification mode.

Parameters:

  horizontal,: | EGUIA_UPPERLEFT for left justified (default), EGUIA_LOWEERRIGHT for right justified, or EGUIA_CENTER for centered text.
  vertical,: | EGUIA_UPPERLEFT to align with top edge (default), EGUIA_LOWEERRIGHT for bottom edge, or EGUIA_CENTER for centered text.

virtual void irr::gui::IGUIStaticText::setTextRestrainedInside | ( | bool | restrainedInside | ) | `[pure virtual]`

Set whether the text in this label should be clipped if it goes outside bounds.

virtual void irr::gui::IGUIStaticText::setWordWrap | ( | bool | enable | ) | `[pure virtual]`

Enables or disables word wrap for using the static text as multiline text control.

Parameters:

  enable,: | If set to true, words going over one line are broken on to the next line.

The documentation for this class was generated from the following file:

- IGUIStaticText.h