Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members | Tutorials

# 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
virtual void | enableOverrideColor (bool enable)=0
| Sets if the static text should use the overide color or the color in the gui skin.
virtual video::SColor const & | 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.
| IGUIStaticText (IGUIEnvironment *environment, IGUIElement *parent, s32 id, core::rect< s32 > rectangle)
| constructor
virtual bool | isOverrideColorEnabled (void) const =0
| Checks if an override color is enabled.
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 | setTextAlignment (EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical)=0
| Sets text justification mode.
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 video::SColor const& 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::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::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::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, EGUIA_LOWEERRIGHT for bottom edge, or EGUIA_CENTER for centered text (default).

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

| The Irrlicht Engine Documentation © 2003-2009 by Nikolaus Gebhardt. Generated on Sun Jan 10 09:24:11 2010 by Doxygen (1.5.6)