Changeset 8371 for code/branches/tutoriallevel2/src/libraries/core
- Timestamp:
- May 1, 2011, 2:43:33 PM (14 years ago)
- Location:
- code/branches/tutoriallevel2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/tutoriallevel2
- Property svn:mergeinfo changed
/code/branches/tutoriallevel (added) merged: 7828-7831,7894,8370
- Property svn:mergeinfo changed
-
code/branches/tutoriallevel2/src/libraries/core/GUIManager.cc
r8351 r8371 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> … … 649 651 } 650 652 653 /** 654 @brief 655 Adds a new freetype font to the CEGUI system. 656 @param name 657 The name of the new font. 658 @param size 659 The font size of the new font in pixels. 660 @param fontName 661 The filename of the font. 662 */ 663 /*static*/ void GUIManager::addFontHelper(const std::string& name, int size, const std::string& fontName) 664 { 665 if(CEGUI::FontManager::getSingleton().isFontPresent(name)) // If a font with that name already exists. 666 return; 667 668 CEGUI::Font* font = NULL; 669 CEGUI::XMLAttributes xmlAttributes; 670 671 // Attributes specified within CEGUIFont 672 xmlAttributes.add("Name", name); 673 xmlAttributes.add("Filename", fontName); 674 xmlAttributes.add("ResourceGroup", ""); 675 xmlAttributes.add("AutoScaled", "true"); 676 xmlAttributes.add("NativeHorzRes", "800"); 677 xmlAttributes.add("NativeVertRes", "600"); 678 679 // Attributes specified within CEGUIXMLAttributes 680 xmlAttributes.add("Size", multi_cast<std::string>(size)); 681 xmlAttributes.add("AntiAlias", "true"); 682 683 font = CEGUI::FontManager::getSingleton().createFont("FreeType", xmlAttributes); 684 if(font != NULL) 685 font->load(); 686 } 687 651 688 } -
code/branches/tutoriallevel2/src/libraries/core/GUIManager.h
r8351 r8371 125 125 126 126 // TODO: Temporary hack because the tolua exported CEGUI method does not seem to work 127 static void subscribeEventHelper(CEGUI::Window* window, const std::string& event, const std::string& function); //tolua_export 128 static void setTooltipTextHelper(CEGUI::ListboxItem* item, const std::string& toooltip); //tolua_export 129 static void setItemTooltipsEnabledHelper(CEGUI::Listbox* listbox, bool enabled); //tolua_export 127 static void subscribeEventHelper(CEGUI::Window* window, const std::string& event, const std::string& function); // tolua_export 128 static void setTooltipTextHelper(CEGUI::ListboxItem* item, const std::string& toooltip); // tolua_export 129 static void setItemTooltipsEnabledHelper(CEGUI::Listbox* listbox, bool enabled); // tolua_export 130 static void addFontHelper(const std::string& name, int size, const std::string& fontName); // tolua_export 130 131 131 132 static GUIManager& getInstance() { return Singleton<GUIManager>::getInstance(); } // tolua_export
Note: See TracChangeset
for help on using the changeset viewer.