Game Development Reference
In-Depth Information
The GetNumberCharactersInSet() function returns the current number of characters in the
character set.
int GetNumberCharactersInSet() {return m_NumberCharacters;}
The GetCharacter() function returns the BillBoardFont object associated with this character set
located at place index. (See Listing 6-17.)
Listing 6-17. GetCharacter Function
BillBoardFont GetCharacter(int index)
{
BillBoardFont Font = null;
if (index < m_NumberCharacters)
{
Font = m_CharacterSet[index];
}
return Font;
}
The GetFontWidth() function gets the width of the bitmap that represents a character for this
character set. (See Listing 6-18.)
Listing 6-18. Getting the Width of the Font
int GetFontWidth()
{
int Width = 0;
if (m_NumberCharacters > 0)
{
BillBoardFont Character = m_CharacterSet[0];
Texture Tex = Character.GetTexture(0);
Bitmap Image = Tex.GetTextureBitMap();
Width = Image.getWidth();
}
return Width;
}
The GetFontHeight() function returns the height of the bitmap that represents a character for this
character set. (See Listing 6-19.)
Listing 6-19. Getting the Font Height
int GetFontHeight()
{
int Height = 0;
if (m_NumberCharacters > 0)
{
BillBoardFont Character = m_CharacterSet[0];
Texture Tex = Character.GetTexture(0);
 
Search WWH ::




Custom Search