Gel2D - The free/open source game creation suite

Public Member Functions
gel::GelGUIText Class Reference

GUI text widget. More...

#include <gelGUIWidget.h>

Inheritance diagram for gel::GelGUIText:
gel::GelGUIWidget gel::GelObject gel::GelTextureObject gel::GelEventReceiver

List of all members.

Public Member Functions

 GelGUIText ()
 Default constructor.
 GelGUIText (GelFont *fnt)
 Default constructor.
 GelGUIText (GelFont *fnt, const char *st,...)
 Convenience constructor.
GelFontgetFont () const
 Gets the font associated with this widget.
void setFont (GelFont *fnt)
 Sets the font to be used by this widget.
void setString (const char *st,...)
 Sets the text that will be rendered to the screen.
int getCharSpacing () const
 Gets the spacing between characters.
void setCharSpacing (int dist)
 Sets the spacing between characters.
void setLineSpacing (int dist)
 Sets the spacing between lines of text.
int getLineSpacing () const
 Gets the spacing between lines of text.
void setAlignment (int align)
int getAlignment () const
void setMaxLineLength (int len)
 Sets the maximum line length.
int getMaxLineLength () const
 Gets the maximum line length.
float getStringLength ()
 Gets the length of the text's string.
void setTexture (GelTexture *tex)
 Sets the widget's texture.
void render ()
 Renders the widget to the screen.

Detailed Description

GUI text widget.


Constructor & Destructor Documentation

gel::GelGUIText::GelGUIText ( )

Default constructor.

gel::GelGUIText::GelGUIText ( GelFont fnt)

Default constructor.

gel::GelGUIText::GelGUIText ( GelFont fnt,
const char *  st,
  ... 
)

Convenience constructor.

Parameters:
fnt: A GelFont object.
st: The string.
...: Optional arguments list.

Member Function Documentation

GelFont* gel::GelGUIText::getFont ( ) const [inline]

Gets the font associated with this widget.

Returns:
Pointer to a GelFont.
void gel::GelGUIText::setFont ( GelFont fnt)

Sets the font to be used by this widget.

Parameters:
fnt: A GelFont object.
void gel::GelGUIText::setString ( const char *  st,
  ... 
)

Sets the text that will be rendered to the screen.

Parameters:
st: The string.
...: Optional arguments list.
int gel::GelGUIText::getCharSpacing ( ) const [inline]

Gets the spacing between characters.

Returns:
The amount of space between characters in pixels.
void gel::GelGUIText::setCharSpacing ( int  dist) [inline]

Sets the spacing between characters.

Parameters:
dist: The number of pixels the characters should be spaced apart.
void gel::GelGUIText::setLineSpacing ( int  dist) [inline]

Sets the spacing between lines of text.

Parameters:
dist: The number of pixels the lines of text should be spaced apart.
int gel::GelGUIText::getLineSpacing ( ) const [inline]

Gets the spacing between lines of text.

Returns:
The amount of space between lines of text in pixels.
void gel::GelGUIText::setAlignment ( int  align) [inline]
int gel::GelGUIText::getAlignment ( ) const [inline]
void gel::GelGUIText::setMaxLineLength ( int  len) [inline]

Sets the maximum line length.

If the text string is longer than the maximum line length, it will start a new line below the previous one.

Parameters:
len: The maximum line length in pixels.
int gel::GelGUIText::getMaxLineLength ( ) const [inline]

Gets the maximum line length.

Returns:
The maximum line length in pixels.
float gel::GelGUIText::getStringLength ( )

Gets the length of the text's string.

Depending on whether the orientation of the text is horizontal or vertical, it will return the length or height of the string, respectively.

Returns:
The length of the string in pixels.
void gel::GelGUIText::setTexture ( GelTexture tex)

Sets the widget's texture.

Parameters:
tex: The widget's new texture.
void gel::GelGUIText::render ( ) [virtual]

Renders the widget to the screen.

Reimplemented from gel::GelObject.


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