syBR::Game::GUIFont Class Reference

GUI font class. More...

#include <GUIFont.hpp>

List of all members.

Public Member Functions

 GUIFont (const std::string &name, Core::Logger *pLogger)
 Constructor.
virtual ~GUIFont ()
 Destructor.
bool load ()
 Load font descriptor and the associated texture.
void render (const std::string &text, const Ogre::Vector2 &position, float size, const Ogre::ColourValue &color, std::vector< GUIManager::Quad > &renderList)
 Render some text.

Private Attributes

Core::Loggerm_pLogger
 Pointer to the logger to be used.
bool m_loaded
 Indicates if the font is already loaded.
std::string m_name
 Name.
std::string m_textureName
 Texture name.
FontDescriptor m_descriptor
 Font descriptor.
CharacterDescriptor m_characters [CHARACTER_COUNT]
 Characters descriptors.

Classes

struct  CharacterDescriptor
 Structure used internally to describe a font character. More...
struct  FontDescriptor
 Structure used internally to describle a font. More...


Detailed Description

GUI font class.

It loads a bitmap font descriptor from Bitmap Font Generator (visit www.AngelCode.com) and allows to retrieve rendering informations for each character in the font.

Note:
Only fonts with ONE page are supported, others are not.

Constructor & Destructor Documentation

syBR::Game::GUIFont::GUIFont ( const std::string &  name,
Core::Logger pLogger 
)

Constructor.

Parameters:
name Name of the widget
pLogger Pointer to the instance of the logger to use

syBR::Game::GUIFont::~GUIFont (  )  [virtual]

Destructor.

Release used resources.


Member Function Documentation

bool syBR::Game::GUIFont::load (  ) 

Load font descriptor and the associated texture.

Returns:
One of these:
  • true in case of success
  • false otherwise

void syBR::Game::GUIFont::render ( const std::string &  text,
const Ogre::Vector2 &  position,
float  size,
const Ogre::ColourValue &  color,
std::vector< GUIManager::Quad > &  renderList 
)

Render some text.

Parameters:
text Text to render
position Top left position of the text in Ogre coordinates
size Size factor (1.0 to use normal size)
color Color of the text
renderList List of renderables where all the renderables needed to render the requested text will be pushed back


Member Data Documentation

Core::Logger* syBR::Game::GUIFont::m_pLogger [private]

Pointer to the logger to be used.

bool syBR::Game::GUIFont::m_loaded [private]

Indicates if the font is already loaded.

std::string syBR::Game::GUIFont::m_name [private]

Name.

std::string syBR::Game::GUIFont::m_textureName [private]

Texture name.

FontDescriptor syBR::Game::GUIFont::m_descriptor [private]

Font descriptor.

CharacterDescriptor syBR::Game::GUIFont::m_characters[CHARACTER_COUNT] [private]

Characters descriptors.


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

Copyright © 2008 by Sebastien Frippiat
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.
Last modified Tue Dec 30 17:57:33 2008