dEngine
Simple 2D C++ game engine
FontManager.h
Go to the documentation of this file.
1 #ifndef DENGINE_FONTMANAGER_H
2 #define DENGINE_FONTMANAGER_H
3 
4 #include <map>
5 #include <string>
6 #include <SDL_ttf.h>
7 
8 namespace dengine_UI {
13  class FontManager {
14  public:
22  void AddFont(std::string name,std::string filePath, int size);
28  void RemoveFont(std::string name);
33  ~FontManager();
34 
35  SDL_Texture* Text(std::string fontName, SDL_Color color, std::string text);
42  static FontManager &GetInstance();
43  private:
45  std::map<std::string,TTF_Font*> fonts;
46  };
47 }
48 #endif //DENGINE_FONTMANAGER_H
void AddFont(std::string name, std::string filePath, int size)
Add a font to the system.
Definition: FontManager.cpp:16
Definition: Circle.h:11
void RemoveFont(std::string name)
Remove a font.
Definition: FontManager.cpp:24
static FontManager & GetInstance()
Returns an instance of the font manager.
Definition: FontManager.cpp:38
SDL_Texture * Text(std::string fontName, SDL_Color color, std::string text)
Definition: FontManager.cpp:30
Font Manager.
Definition: FontManager.h:13
~FontManager()
Destructor.
Definition: FontManager.cpp:10
std::map< std::string, TTF_Font * > fonts
Definition: FontManager.h:45
static FontManager * instance
Definition: FontManager.h:44