A sprite font used for get characters (glyps) from a particular texture.
More...
#include <SpriteFont.h>
|
typedef int | Key |
|
typedef Sprite | Glyph |
|
|
typedef std::map< Key, Glyph * > | FontMap |
|
|
std::string | _name |
|
Texture * | _pFontTexture |
|
FontMap | _fontMap |
|
A sprite font used for get characters (glyps) from a particular texture.
SpriteFonts are created and maintained by tge SpriteFontManager.
◆ SpriteFont()
SpriteFont::SpriteFont |
( |
const std::string & |
filePath | ) |
|
Constructor taking in a filePath.
- Parameters
-
filePath | Full pathname of the file of texture and xml file. |
◆ createSprite()
Sprite * SpriteFont::createSprite |
( |
Key |
key, |
|
|
int |
x, |
|
|
int |
y, |
|
|
int |
w, |
|
|
int |
h |
|
) |
| |
|
private |
Creates a sprite.
- Parameters
-
parameter1 | The first parameter. |
x | The x coordinate. |
y | The y coordinate. |
w | The width. |
h | The height. |
- Returns
- Null if it fails, else the new sprite.
◆ elementTextToInt()
void SpriteFont::elementTextToInt |
( |
IXmlReader * |
pReader, |
|
|
int & |
out |
|
) |
| |
|
private |
Converts element text to int.
- Parameters
-
pReader | the reader. |
out | [in,out] The out. |
◆ getGlyph()
Gets a glyph.
- Parameters
-
- Returns
- pointer to a glyph.
◆ getName()
const std::string & SpriteFont::getName |
( |
| ) |
const |
Gets the name of the font
- Returns
- The name.
◆ loadImageIntoImageManager()
void SpriteFont::loadImageIntoImageManager |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
w, |
|
|
int |
h, |
|
|
const std::string & |
name |
|
) |
| |
|
private |
Loads image into image manager.
- Parameters
-
x | The x coordinate. |
y | The y coordinate. |
w | The width. |
h | The height. |
name | The name. |
◆ parseXMLtoCollection()
void SpriteFont::parseXMLtoCollection |
( |
const std::string & |
filename | ) |
|
|
private |
Parses XML file.
- Parameters
-
filename | Filename of the the XML. |
The documentation for this class was generated from the following files: