Open Source Tomb Raider Engine
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

Font.h 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*!
  2. * \file include/system/Font.h
  3. * \brief Font interface
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _FONT_H_
  8. #define _FONT_H_
  9. #include <string>
  10. /*!
  11. * \brief Font interface
  12. */
  13. class Font {
  14. public:
  15. static void shutdown();
  16. static int initialize(std::string font = "");
  17. static std::string getFontName() { return fontName; }
  18. static unsigned int widthText(float scale, std::string s);
  19. static unsigned int heightText(float scale, unsigned int maxWidth, std::string s);
  20. static void drawText(unsigned int x, unsigned int y, float scale,
  21. const unsigned char color[4], std::string s);
  22. static void drawTextWrapped(unsigned int x, unsigned int y, float scale,
  23. const unsigned char color[4], unsigned int maxWidth, std::string s);
  24. static void drawTextCentered(unsigned int x, unsigned int y, float scale,
  25. const unsigned char color[4], unsigned int width, std::string s);
  26. private:
  27. static bool isInit;
  28. static std::string fontName;
  29. };
  30. #endif