UGDK
|
00001 #ifndef HORUSEYE_FRAMEWORK_TEXTMANAGER_H_ 00002 #define HORUSEYE_FRAMEWORK_TEXTMANAGER_H_ 00003 00004 #include <vector> 00005 #include <map> 00006 #include <ugdk/math/vector2D.h> 00007 #include <ugdk/graphic.h> 00008 00009 #define TEXT_MANAGER() ugdk::Engine::reference()->text_manager() 00010 00011 namespace ugdk { 00012 namespace graphic { 00013 00014 class TextManager { 00015 public: 00016 TextManager() : current_font_(NULL) {} 00017 ~TextManager(); 00018 00019 bool Initialize(); 00020 bool Release(); 00021 00022 Text* GetText( const std::wstring& text); 00023 Text* GetText( const std::wstring& text, const std::string& font, int width = -1); 00024 Text* GetTextFromFile(const std:: string& path); 00025 Text* GetTextFromFile(const std:: string& path, const std::string& font, int width = -1); 00026 00027 void AddFont(const std::string& name, const std::string& path, int size, char ident, bool fancy); 00028 00029 private: 00030 Font *current_font_; 00031 std::map<std::string, Texture**> font_images_; 00032 std::map<std::string, Font*> fonts_; 00033 }; 00034 00035 } // namespace graphic 00036 } // namespace ugdk 00037 00038 #endif