Open Source Tomb Raider Engine
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

Font.h 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*!
  2. * \file include/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