Main Page | Class Hierarchy | Class List | File List | Class Members | Related Pages

CBitmapFont Class Reference

Bitmap Font class. More...

#include <BitmapFont.h>

Inheritance diagram for CBitmapFont:

CCustomFont CXMLResource CResource CEntity List of all members.

Public Member Functions

virtual int LoadXML (TiXmlNode *pDataNode, CString strFilename)
virtual int SaveXML (TiXmlNode *pDataNode, CString strFilename)
virtual void Destroy ()
virtual void Draw (CString strFormat,...)
virtual void DrawChar (float x, float y, char c)
virtual int Create (UINT uiNormalOrItalic, UINT uiCharLength, UINT uiCharHeight, UINT uiQuadLength, UINT uiQuadHeight, UINT uiSpacing)
void SetTextPos (float X, float Y)
tVERTEX2fGetTextPos ()
UINT GetQuadLength ()
UINT GetQuadHeight ()
UINT GetCharLength ()
UINT GetCharHeight ()
UINT GetSpacing ()
virtual bool IsOfType (eEntityType eType)

Protected Attributes

CTexturem_pTexture
CMaterialm_pMaterial
UINT m_uiNI
UINT m_uiCharLength
UINT m_uiCharHeight
UINT m_uiQuadLength
UINT m_uiQuadHeight
UINT m_uiSpacing
UINT m_uiFontBase
UINT m_uiNumLists
tVERTEX2f m_TextPos

Detailed Description

Bitmap Font class.

This class is an implementation of generic font interface class, that uses texture to output textured quads with letters.

Definition at line 14 of file BitmapFont.h.


Member Function Documentation

int CBitmapFont::Create UINT  uiNormalOrItalic,
UINT  uiCharLength,
UINT  uiCharHeight,
UINT  uiQuadLength,
UINT  uiQuadHeight,
UINT  uiSpacing
[virtual]
 

Method details:

Parameters:
uiNormalOrItalic - Is it normal or italic text?
uiCharLength - Character length (in the texture)
uiCharHeight - Character height (in the texture)
uiQuadLength - Quad length for all characters
uiQuadHeight - Quad height for all characters
uiSpacing - Spacing between quads when drawing them
Returns:
1 if created succesfully, 0 otherwise
Definition at line 27 of file BitmapFont.cpp.

References CTexture::Bind(), m_pTexture, m_uiCharLength, m_uiFontBase, m_uiNI, m_uiNumLists, m_uiQuadLength, and m_uiSpacing.

Referenced by LoadXML().

void CBitmapFont::Destroy  )  [virtual]
 

Method details: Clean-up method

Reimplemented from CCustomFont.

Definition at line 219 of file BitmapFont.cpp.

void CBitmapFont::Draw CString  strFormat,
  ...
[virtual]
 

Method details:

Parameters:
strFormat - Format of passed parameters

Implements CCustomFont.

Definition at line 224 of file BitmapFont.cpp.

References CTexture::Bind(), CMaterial::GetAmbient(), m_pMaterial, m_pTexture, m_TextPos, m_uiFontBase, m_uiNI, tVERTEX2f::x, and tVERTEX2f::y.

Referenced by CGUIStatic::DrawText().

void CBitmapFont::DrawChar float  x,
float  y,
char  c
[virtual]
 

Method details:

Parameters:
x,y - 2D coordinate to draw character at
c - character (letter or symbol) to draw

Implements CCustomFont.

Definition at line 269 of file BitmapFont.cpp.

UINT CBitmapFont::GetCharHeight  ) 
 

Method details:

Returns:
Characters height (in pixels)
Definition at line 299 of file BitmapFont.cpp.

References m_uiCharHeight.

UINT CBitmapFont::GetCharLength  ) 
 

Method details:

Returns:
Characters length (in pixels)
Definition at line 294 of file BitmapFont.cpp.

References m_uiCharLength.

UINT CBitmapFont::GetQuadHeight  ) 
 

Method details:

Returns:
Quad height (units)
Definition at line 289 of file BitmapFont.cpp.

References m_uiQuadHeight.

Referenced by CGUIStatic::DrawText(), CGUIListBox::Resize(), and CGUIDropList::Resize().

UINT CBitmapFont::GetQuadLength  ) 
 

Method details:

Returns:
Quad length (units)
Definition at line 284 of file BitmapFont.cpp.

References m_uiQuadLength.

Referenced by CGUIStatic::DrawText(), and CGUIDropList::Resize().

UINT CBitmapFont::GetSpacing  ) 
 

Method details:

Returns:
Spacing between quads (units)
Definition at line 304 of file BitmapFont.cpp.

References m_uiSpacing.

Referenced by CGUIDropList::Resize().

tVERTEX2f & CBitmapFont::GetTextPos  ) 
 

Method details:

Returns:
Const. Reference to 2D coordinate from where text is being drawn
Definition at line 279 of file BitmapFont.cpp.

References m_TextPos.

bool CBitmapFont::IsOfType eEntityType  eType  )  [virtual]
 

Method details: This is an implementation of Custom RTTI

Reimplemented from CCustomFont.

Definition at line 309 of file BitmapFont.cpp.

References CCustomFont::IsOfType().

int CBitmapFont::LoadXML TiXmlNode pDataNode,
CString  strFilename
[virtual]
 

Method details:

Parameters:
pDataNode - Pointer to XML Node that holds data for the animation
strFilename - String containing filename where the data for the animation is stored

Reimplemented from CCustomFont.

Definition at line 75 of file BitmapFont.cpp.

References TiXmlElement::Attribute(), Create(), CSingleton< CMaterialManager >::GetSingleton(), CSingleton< CTextureManager >::GetSingleton(), CMaterialManager::LoadResource(), CTextureManager::LoadResource(), CCustomFont::LoadXML(), m_pMaterial, m_pTexture, m_uiCharHeight, m_uiCharLength, m_uiNI, m_uiQuadHeight, m_uiQuadLength, m_uiSpacing, and TiXmlNode::pcValue().

int CBitmapFont::SaveXML TiXmlNode pDataNode,
CString  strFilename
[virtual]
 

Method details:

Parameters:
pDataNode - Pointer to XML Node that will be the parent hold the data for this animation
strFilename - String containing filename where the data for the animation is stored

Reimplemented from CCustomFont.

Definition at line 147 of file BitmapFont.cpp.

References CEntity::GetName(), TiXmlNode::InsertEndChild(), m_pMaterial, m_pTexture, m_uiCharHeight, m_uiCharLength, m_uiNI, m_uiQuadHeight, m_uiQuadLength, m_uiSpacing, TiXmlDocument::SaveFile(), TiXmlElement::SetAttribute(), and TiXmlNode::ToElement().

void CBitmapFont::SetTextPos float  X,
float  Y
 

Method details:

Parameters:
X,Y - 2D coordinate to start drawing text from
Definition at line 274 of file BitmapFont.cpp.

References m_TextPos, tVERTEX2f::x, and tVERTEX2f::y.

Referenced by CGUIStatic::DrawText().


Member Data Documentation

CMaterial* CBitmapFont::m_pMaterial [protected]
 

Pointer to the material Definition at line 111 of file BitmapFont.h.

Referenced by Draw(), LoadXML(), and SaveXML().

CTexture* CBitmapFont::m_pTexture [protected]
 

Pointer to the texture Definition at line 110 of file BitmapFont.h.

Referenced by Create(), Draw(), LoadXML(), and SaveXML().

tVERTEX2f CBitmapFont::m_TextPos [protected]
 

2D coordinate from where to start drawing text Definition at line 123 of file BitmapFont.h.

Referenced by Draw(), GetTextPos(), and SetTextPos().

UINT CBitmapFont::m_uiCharHeight [protected]
 

Character hieght (in pixels) on the bitmap Definition at line 114 of file BitmapFont.h.

Referenced by GetCharHeight(), LoadXML(), and SaveXML().

UINT CBitmapFont::m_uiCharLength [protected]
 

Character width (in pixels) on the bitmap Definition at line 114 of file BitmapFont.h.

Referenced by Create(), GetCharLength(), LoadXML(), and SaveXML().

UINT CBitmapFont::m_uiFontBase [protected]
 

GL Font List uiID Definition at line 120 of file BitmapFont.h.

Referenced by Create(), and Draw().

UINT CBitmapFont::m_uiNI [protected]
 

Normal or italic attribute Definition at line 113 of file BitmapFont.h.

Referenced by Create(), Draw(), LoadXML(), and SaveXML().

UINT CBitmapFont::m_uiNumLists [protected]
 

Number of GL lists Definition at line 121 of file BitmapFont.h.

Referenced by Create().

UINT CBitmapFont::m_uiQuadHeight [protected]
 

Quad height (int GL units) Definition at line 114 of file BitmapFont.h.

Referenced by GetQuadHeight(), LoadXML(), and SaveXML().

UINT CBitmapFont::m_uiQuadLength [protected]
 

Quad width (in GL units) Definition at line 114 of file BitmapFont.h.

Referenced by Create(), GetQuadLength(), LoadXML(), and SaveXML().

UINT CBitmapFont::m_uiSpacing [protected]
 

Spacing between character quads (GL) Definition at line 114 of file BitmapFont.h.

Referenced by Create(), GetSpacing(), LoadXML(), and SaveXML().


The documentation for this class was generated from the following files:
Generated on Sun Jul 17 21:34:29 2005 for OpenGL GUI by doxygen 1.3.8