Open Source Tomb Raider Engine
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

Font.h 939B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 unsigned int widthText(float scale, std::string s);
  18. static unsigned int heightText(float scale, unsigned int maxWidth, std::string s);
  19. static void drawText(unsigned int x, unsigned int y, float scale,
  20. const unsigned char color[4], std::string s);
  21. static void drawTextWrapped(unsigned int x, unsigned int y, float scale,
  22. const unsigned char color[4], unsigned int maxWidth, std::string s);
  23. static void drawTextCentered(unsigned int x, unsigned int y, float scale,
  24. const unsigned char color[4], unsigned int width, std::string s);
  25. private:
  26. static bool isInit;
  27. static std::string fontName;
  28. };
  29. #endif