SDL2lazy
SlFont.h
Go to the documentation of this file.
1 // part of SDL2lazy
2 // author: Ulrike Hager
3 
8 #ifndef SLFONT_H
9 #define SLFONT_H
10 
11 #include <string>
12 
13 #include <SDL2/SDL.h>
14 #include <SDL2/SDL_ttf.h>
15 
16 
17 
20 class SlFont
21 {
22  public:
25  SlFont(std::string name);
28  ~SlFont();
29 
32  short color[4] = {0, 0, 0, 255};
35  TTF_Font* font() {return font_;}
39  void loadFont(std::string fontfile, int fontsize);
42  std::string name(){ return name_;}
45  SDL_Color sdlcolor();
48  void setAlpha(uint8_t alpha);
51  void setColor(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha);
54  void setColor(uint8_t red, uint8_t green, uint8_t blue);
55 
56  private:
59  TTF_Font* font_;
62  std::string name_;
63 
64 };
65 
66 
67 #endif /* SLFONT_H */
68 
69 
std::string name_
Definition: SlFont.h:62
~SlFont()
Definition: SlFont.cc:21
SlFont(std::string name)
Definition: SlFont.cc:15
TTF_Font * font_
Definition: SlFont.h:59
short color[4]
Definition: SlFont.h:32
TTF_Font * font()
Definition: SlFont.h:35
std::string name()
Definition: SlFont.h:42
void loadFont(std::string fontfile, int fontsize)
Definition: SlFont.cc:28
void setColor(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha)
Definition: SlFont.cc:55
SDL_Color sdlcolor()
Definition: SlFont.cc:38
void setAlpha(uint8_t alpha)
Definition: SlFont.cc:47
Definition: SlFont.h:20