SUNENGINE 0.0.2
A simple and bright C++ game engine.
 
Loading...
Searching...
No Matches
SpriteFont.h
1#ifndef SpriteFont_H
2#define SpriteFont_H
3
4#include <map>
5#include <xmllite.h>
6#include <shlwapi.h>
7
8class Texture;
10
18class SpriteFont
19{
20private:
21 friend class SpriteFontManagerAttorney;
22
26 using Key = int;
27
32
33 SpriteFont() = delete;
34 SpriteFont(const SpriteFont&) = delete;
35 SpriteFont& operator=(const SpriteFont&) = delete;
36 ~SpriteFont();
37
43 SpriteFont(std::string key, std::string path);
44
50 Glyph* GetGlyph(char c);
51
55 std::string Name;
56
60 Texture* FontTexture;
61
65 using SpriteFontMap = std::map<Key, Glyph*>;
66
71
76 void XMLtoCollection(std::string path);
77
83 void ElementTextToInt(IXmlReader* pReader, int& out);
84};
85
86#endif
Represents a sprite in the SUNENGINE.
Definition Sprites/SUNENGINESprite.h:16
Glyph * GetGlyph(char c)
Gets the glyph for a character.
Definition SpriteFont.cpp:26
Texture * FontTexture
Texture for the SpriteFont.
Definition SpriteFont.h:60
SpriteFontMap FontMap
Map of keys to glyphs.
Definition SpriteFont.h:70
void XMLtoCollection(std::string path)
Converts XML data to a collection of glyphs.
Definition SpriteFont.cpp:31
int Key
Key type for the SpriteFont.
Definition SpriteFont.h:26
void ElementTextToInt(IXmlReader *pReader, int &out)
Converts element text to an integer.
Definition SpriteFont.cpp:154
std::map< Key, Glyph * > SpriteFontMap
Collection of glyphs for the SpriteFont.
Definition SpriteFont.h:65
std::string Name
Name of the SpriteFont.
Definition SpriteFont.h:55
SUNENGINESprite Glyph
Glyph type for the SpriteFont.
Definition SpriteFont.h:31