gedi::Text Class Reference

#include <Text.h>

Collaboration diagram for gedi::Text:

[legend]
List of all members.

Public Member Functions

 Text ()
 Text (gedi::Int32 iType)
void Init ()
void Render ()
gedi::Int32 GetWidth (void)
gedi::Int32 GetHeight (void)
void SetFont (gedi::FontType iType)
void SetText (LPSTR lpzText)
void SetText (gedi::Int32 iNumber)
void SetText (gedi::Real32 fReal, LPSTR lpzFormat)
void SetText (gedi::Vector2D kVector)
void SetPosition (gedi::Int32 iX, gedi::Int32 iY)

Static Public Member Functions

static void SetPath (LPSTR lpzPath)
static gedi::Int32 InstallFont (gedi::FontABO &rkFontABO)

Protected Member Functions

virtual gedi::Int32 Map (gedi::UInt8 iChar)

Static Protected Attributes

static FontABO m_akFontABO [MAX_FONTS]

Detailed Description

This class displays text of various font types on the screen.


Constructor & Destructor Documentation

gedi::Text::Text (  ) 

Constructor, default font is gedi::FontCourierSmall.

gedi::Text::Text ( gedi::Int32  iType  ) 

Constructor.

Parameters:
iType Font type.
See also:
gedi::FontType


Member Function Documentation

void gedi::Text::Init (  ) 

Initialize the text with the font. This is automatically done on first Render attempt. If you invoke GetWidth, etc., on Text before Render, you must first invoke SetPath followed by Init.

void gedi::Text::Render (  ) 

Renders the text on the display.

gedi::Int32 gedi::Text::GetWidth ( void   ) 

Gets the width of the current text string setting.

Returns:
Width of the text string.

gedi::Int32 gedi::Text::GetHeight ( void   ) 

Gets the one-line height of the font.

Returns:
Height of the font.

void gedi::Text::SetFont ( gedi::FontType  iType  )  [inline]

Sets the font type.

Parameters:
iType Font type.
See also:
gedi::FontType

void gedi::Text::SetText ( LPSTR  lpzText  )  [inline]

Set the text string, persists until set to another string.

Parameters:
lpzText String, copied by the method.

void gedi::Text::SetText ( gedi::Int32  iNumber  ) 

Set the text string as an integer.

Parameters:
iNumber Number to convert to a string.

void gedi::Text::SetText ( gedi::Real32  fReal,
LPSTR  lpzFormat 
)

Set the text string as a real.

Parameters:
fReal Number to convert to a string *.
lpzFormat Format specifications, a sprintf-type float spec.

void gedi::Text::SetText ( gedi::Vector2D  kVector  ) 

Set the text string as a vector.

Parameters:
kVector Vector.

void gedi::Text::SetPosition ( gedi::Int32  iX,
gedi::Int32  iY 
) [inline]

Set the upper left position of the string.

Parameters:
iX X coordinate.
iY Y coordinate.

static void gedi::Text::SetPath ( LPSTR  lpzPath  )  [inline, static]

Set font directory path.

Parameters:
lpzPath Directory path of fonts.

gedi::Int32 gedi::Text::InstallFont ( gedi::FontABO rkFontABO  )  [static]

Installs a new font.

Parameters:
rkFontABO Font to install.
Returns:
Font type, can be used with SetType method.

gedi::Int32 gedi::Text::Map ( gedi::UInt8  iChar  )  [protected, virtual]

Maps a character to an animation in the font bitmap.

Parameters:
iChar Character.
Returns:
Animation number in the range of the bitmap.


Member Data Documentation

gedi::FontABO gedi::Text::m_akFontABO [static, protected]

Font table


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