SUNENGINE 0.0.2
A simple and bright C++ game engine.
 
Loading...
Searching...
No Matches
SpriteFont Class Reference

Represents a font in the SUNENGINE. More...

#include <SpriteFont.h>

Private Types

using Key = int
 Key type for the SpriteFont.
 
using Glyph = SUNENGINESprite
 Glyph type for the SpriteFont.
 
using SpriteFontMap = std::map<Key, Glyph*>
 Collection of glyphs for the SpriteFont.
 

Private Member Functions

 SpriteFont (const SpriteFont &)=delete
 
SpriteFontoperator= (const SpriteFont &)=delete
 
 SpriteFont (std::string key, std::string path)
 Constructor for SpriteFont with a key and path.
 
GlyphGetGlyph (char c)
 Gets the glyph for a character.
 
void XMLtoCollection (std::string path)
 Converts XML data to a collection of glyphs.
 
void ElementTextToInt (IXmlReader *pReader, int &out)
 Converts element text to an integer.
 

Private Attributes

std::string Name
 Name of the SpriteFont.
 
Texture * FontTexture
 Texture for the SpriteFont.
 
SpriteFontMap FontMap
 Map of keys to glyphs.
 

Friends

class SpriteFontManagerAttorney
 

Detailed Description

Represents a font in the SUNENGINE.

The SpriteFont class is responsible for managing and rendering a font in the SUNENGINE. It provides methods to get glyphs and convert XML data to a collection of glyphs.

Constructor & Destructor Documentation

◆ SpriteFont()

SpriteFont::SpriteFont ( std::string key,
std::string path )
private

Constructor for SpriteFont with a key and path.

Parameters
keyThe key associated with the font.
pathThe path to the XML file.
Here is the call graph for this function:

Member Function Documentation

◆ ElementTextToInt()

void SpriteFont::ElementTextToInt ( IXmlReader * pReader,
int & out )
private

Converts element text to an integer.

Parameters
pReaderPointer to the XML reader.
outReference to the output integer.
Here is the caller graph for this function:

◆ GetGlyph()

SpriteFont::Glyph * SpriteFont::GetGlyph ( char c)
private

Gets the glyph for a character.

Parameters
cThe character for which to get the glyph.
Returns
Pointer to the glyph for the character.
Here is the caller graph for this function:

◆ XMLtoCollection()

void SpriteFont::XMLtoCollection ( std::string path)
private

Converts XML data to a collection of glyphs.

Parameters
pathThe path to the XML file.
Here is the call graph for this function:
Here is the caller graph for this function:

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