Open Source Tomb Raider Engine
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

FontManager.h 1023B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*!
  2. * \file include/FontManager.h
  3. * \brief Font manager
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _FONT_MANAGER_H_
  8. #define _FONT_MANAGER_H_
  9. #include <vector>
  10. #include "Font.h"
  11. class FontManager : public Font {
  12. public:
  13. /*!
  14. * \brief Constructs an object of FontManager
  15. */
  16. FontManager();
  17. /*!
  18. * \brief Deconstructs an object of FontManager
  19. */
  20. virtual ~FontManager();
  21. virtual int initialize();
  22. virtual unsigned int widthText(float scale, std::string s);
  23. virtual void drawText(unsigned int x, unsigned int y, float scale,
  24. const unsigned char color[4], std::string s);
  25. virtual unsigned int heightText(float scale, unsigned int maxWidth, std::string s);
  26. virtual void drawTextWrapped(unsigned int x, unsigned int y, float scale,
  27. const unsigned char color[4], unsigned int maxWidth, std::string s);
  28. private:
  29. void add(Font *f, std::string e);
  30. int font;
  31. std::vector<Font *> fonts;
  32. std::vector<std::string> extensions;
  33. };
  34. #endif