OpenRaider  0.1.4-dev
Open Source Tomb Raider Game Engine implementation
Font.h
Go to the documentation of this file.
1 
8 #ifndef _FONT_H_
9 #define _FONT_H_
10 
11 #include <string>
12 
16 class Font {
17  public:
18  static void shutdown();
19 
20  static int initialize(std::string font = "");
21 
22  static std::string getFontName() { return fontName; }
23 
24  static unsigned int widthText(float scale, std::string s);
25 
26  static unsigned int heightText(float scale, unsigned int maxWidth, std::string s);
27 
28  static void drawText(unsigned int x, unsigned int y, float scale,
29  glm::vec4 color, std::string s);
30 
31  static void drawTextWrapped(unsigned int x, unsigned int y, float scale,
32  glm::vec4 color, unsigned int maxWidth, std::string s);
33 
34  static void drawTextCentered(unsigned int x, unsigned int y, float scale,
35  glm::vec4 color, unsigned int width, std::string s);
36 
37  static void setShowFontBox(bool s) { showFontBox = s; }
38  static bool getShowFontBox() { return showFontBox; }
39 
40  private:
41  static void drawFontBox(unsigned int x, unsigned int y, unsigned int w, unsigned int h);
42 
43  static bool isInit;
44  static std::string fontName;
45  static bool showFontBox;
46 };
47 
48 #endif
49 
static unsigned int widthText(float scale, std::string s)
Definition: Font.cpp:44
static void drawTextWrapped(unsigned int x, unsigned int y, float scale, glm::vec4 color, unsigned int maxWidth, std::string s)
Definition: Font.cpp:81
Font interface.
Definition: Font.h:16
static void drawTextCentered(unsigned int x, unsigned int y, float scale, glm::vec4 color, unsigned int width, std::string s)
Definition: Font.cpp:100
static bool getShowFontBox()
Definition: Font.h:38
static std::string getFontName()
Definition: Font.h:22
static unsigned int heightText(float scale, unsigned int maxWidth, std::string s)
Definition: Font.cpp:54
static void setShowFontBox(bool s)
Definition: Font.h:37
static int initialize(std::string font="")
Definition: Font.cpp:28
static void shutdown()
Definition: Font.cpp:23
static std::string fontName
Definition: Font.h:44
static void drawText(unsigned int x, unsigned int y, float scale, glm::vec4 color, std::string s)
Definition: Font.cpp:64
static void drawFontBox(unsigned int x, unsigned int y, unsigned int w, unsigned int h)
Definition: Font.cpp:105
static const float scale
Definition: Sprite.cpp:15
static bool showFontBox
Definition: Font.h:45
static bool isInit
Definition: Font.h:43