Changeset 7894 for code/branches/tutoriallevel/src/libraries/core
- Timestamp:
- Feb 14, 2011, 11:02:58 PM (14 years ago)
- Location:
- code/branches/tutoriallevel/src/libraries/core
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/tutoriallevel/src/libraries/core/GUIManager.cc
r7811 r7894 37 37 #include <CEGUIDefaultLogger.h> 38 38 #include <CEGUIExceptions.h> 39 #include <CEGUIFontManager.h> 39 40 #include <CEGUIInputEvent.h> 40 41 #include <CEGUIMouseCursor.h> … … 43 44 #include <CEGUIWindow.h> 44 45 #include <CEGUIWindowManager.h> 46 #include <CEGUIXMLAttributes.h> 45 47 #include <elements/CEGUIListbox.h> 46 48 #include <elements/CEGUIListboxItem.h> … … 498 500 } 499 501 502 /** 503 @brief 504 Adds a new freetype font to the CEGUI system. 505 @param name 506 The name of the new font. 507 @param size 508 The font size of the new font in pixels. 509 @param fontName 510 The filename of the font. 511 */ 512 /*static*/ void GUIManager::addFontHelper(const std::string& name, int size, const std::string& fontName) 513 { 514 if(CEGUI::FontManager::getSingleton().isFontPresent(name)) // If a font with that name already exists. 515 return; 516 517 CEGUI::Font* font = NULL; 518 CEGUI::XMLAttributes xmlAttributes; 519 520 // Attributes specified within CEGUIFont 521 xmlAttributes.add("Name", name); 522 xmlAttributes.add("Filename", fontName); 523 xmlAttributes.add("ResourceGroup", ""); 524 xmlAttributes.add("AutoScaled", "true"); 525 xmlAttributes.add("NativeHorzRes", "800"); 526 xmlAttributes.add("NativeVertRes", "600"); 527 528 // Attributes specified within CEGUIXMLAttributes 529 xmlAttributes.add("Size", multi_cast<std::string>(size)); 530 xmlAttributes.add("AntiAlias", "true"); 531 532 font = CEGUI::FontManager::getSingleton().createFont("FreeType", xmlAttributes); 533 if(font != NULL) 534 font->load(); 535 } 536 500 537 } -
code/branches/tutoriallevel/src/libraries/core/GUIManager.h
r7801 r7894 109 109 110 110 // TODO: Temporary hack because the tolua exported CEGUI method does not seem to work 111 static void subscribeEventHelper(CEGUI::Window* window, const std::string& event, const std::string& function); //tolua_export 112 static void setTooltipTextHelper(CEGUI::ListboxItem* item, const std::string& toooltip); //tolua_export 113 static void setItemTooltipsEnabledHelper(CEGUI::Listbox* listbox, bool enabled); //tolua_export 111 static void subscribeEventHelper(CEGUI::Window* window, const std::string& event, const std::string& function); // tolua_export 112 static void setTooltipTextHelper(CEGUI::ListboxItem* item, const std::string& toooltip); // tolua_export 113 static void setItemTooltipsEnabledHelper(CEGUI::Listbox* listbox, bool enabled); // tolua_export 114 static void addFontHelper(const std::string& name, int size, const std::string& fontName); // tolua_export 114 115 115 116 static GUIManager& getInstance() { return Singleton<GUIManager>::getInstance(); } // tolua_export
Note: See TracChangeset
for help on using the changeset viewer.