#include <hgeimagefont.hpp>
Inheritance diagram for gcn::HGEImageFont:

As HGE does not support colorkey blitting of images it's recommended to use HGE's internal font in Guichan.
Definition at line 77 of file hgeimagefont.hpp.
Public Member Functions | |
| void | drawString (Graphics *graphics, const std::string &text, int x, int y) |
| Draws a string. | |
| virtual hgeFont * | getFont () const |
| Gets the loaded HGE font. | |
| int | getHeight () const |
| Gets the height of the glyphs in the font. | |
| int | getStringIndexAt (const std::string &text, int x) |
| int | getWidth (const std::string &text) const |
| Gets the width of a string. | |
| int | getWidth (char character) const |
| Gets the width from a character. | |
| HGEImageFont (const std::string &filename) | |
| Constructor. | |
| ~HGEImageFont () | |
| Destructor. | |
Protected Attributes | |
| hgeFont * | mHGEFont |
| gcn::HGEImageFont::HGEImageFont | ( | const std::string & | filename | ) |
Constructor.
Creates a font from a HGE font file.
| filename | the filename of the HGE font. |
Definition at line 68 of file hgeimagefont.cpp.
References mHGEFont.
| void gcn::HGEImageFont::drawString | ( | Graphics * | graphics, | |
| const std::string & | text, | |||
| int | x, | |||
| int | y | |||
| ) | [virtual] |
Draws a string.
NOTE: You normally won't use this function to draw text since Graphics contains better functions for drawing text.
| graphics | A Graphics object to use for drawing. | |
| text | The string to draw. | |
| x | The x coordinate where to draw the string. | |
| y | The y coordinate where to draw the string. |
Implements gcn::Font.
Definition at line 120 of file hgeimagefont.cpp.
References gcn::Color::a, gcn::Color::b, gcn::Color::g, gcn::Graphics::getColor(), mHGEFont, and gcn::Color::r.
| hgeFont * gcn::HGEImageFont::getFont | ( | ) | const [virtual] |
Gets the loaded HGE font.
The HGE font can be used to set certain properties like setting the blend mode. Properties of the HGE font will effect the Guichan font as well.
Definition at line 78 of file hgeimagefont.cpp.
References mHGEFont.
| int gcn::HGEImageFont::getHeight | ( | ) | const [virtual] |
Gets the height of the glyphs in the font.
Implements gcn::Font.
Definition at line 97 of file hgeimagefont.cpp.
References mHGEFont.
| int gcn::HGEImageFont::getWidth | ( | const std::string & | text | ) | const [virtual] |
Gets the width of a string.
The width of a string is not necesserily the sum of all the widths of it's glyphs.
| text | The string to return the width of. |
Implements gcn::Font.
Definition at line 83 of file hgeimagefont.cpp.
References mHGEFont.
| int gcn::HGEImageFont::getWidth | ( | char | character | ) | const |
Gets the width from a character.
| character | the character to get the width from. |
Definition at line 88 of file hgeimagefont.cpp.
References mHGEFont.
Referenced by getStringIndexAt().
1.5.2