Changeset 8453 for code/branches/tutoriallevel3/src/libraries/core
- Timestamp:
- May 12, 2011, 12:31:23 AM (14 years ago)
- Location:
- code/branches/tutoriallevel3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/tutoriallevel3
- Property svn:mergeinfo changed
/code/branches/tutoriallevel (added) merged: 7828-7831,7894,8370 /code/branches/tutoriallevel2 (added) merged: 8371,8374,8376-8378,8444-8451
- Property svn:mergeinfo changed
-
code/branches/tutoriallevel3/src/libraries/core/GUIManager.cc
r8439 r8453 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> … … 663 665 } 664 666 667 /** 668 @brief 669 Adds a new freetype font to the CEGUI system. 670 @param name 671 The name of the new font. 672 @param size 673 The font size of the new font in pixels. 674 @param fontName 675 The filename of the font. 676 */ 677 /*static*/ void GUIManager::addFontHelper(const std::string& name, int size, const std::string& fontName) 678 { 679 if(CEGUI::FontManager::getSingleton().isFontPresent(name)) // If a font with that name already exists. 680 return; 681 682 CEGUI::Font* font = NULL; 683 CEGUI::XMLAttributes xmlAttributes; 684 685 // Attributes specified within CEGUIFont 686 xmlAttributes.add("Name", name); 687 xmlAttributes.add("Filename", fontName); 688 xmlAttributes.add("ResourceGroup", ""); 689 xmlAttributes.add("AutoScaled", "true"); 690 xmlAttributes.add("NativeHorzRes", "800"); 691 xmlAttributes.add("NativeVertRes", "600"); 692 693 // Attributes specified within CEGUIXMLAttributes 694 xmlAttributes.add("Size", multi_cast<std::string>(size)); 695 xmlAttributes.add("AntiAlias", "true"); 696 697 font = CEGUI::FontManager::getSingleton().createFont("FreeType", xmlAttributes); 698 if(font != NULL) 699 font->load(); 700 } 701 665 702 } -
code/branches/tutoriallevel3/src/libraries/core/GUIManager.h
r8423 r8453 128 128 129 129 // TODO: Temporary hack because the tolua exported CEGUI method does not seem to work 130 static void subscribeEventHelper(CEGUI::Window* window, const std::string& event, const std::string& function); //tolua_export 131 static void setTooltipTextHelper(CEGUI::ListboxItem* item, const std::string& toooltip); //tolua_export 132 static void setItemTooltipsEnabledHelper(CEGUI::Listbox* listbox, bool enabled); //tolua_export 130 static void subscribeEventHelper(CEGUI::Window* window, const std::string& event, const std::string& function); // tolua_export 131 static void setTooltipTextHelper(CEGUI::ListboxItem* item, const std::string& toooltip); // tolua_export 132 static void setItemTooltipsEnabledHelper(CEGUI::Listbox* listbox, bool enabled); // tolua_export 133 static void addFontHelper(const std::string& name, int size, const std::string& fontName); // tolua_export 133 134 134 135 static GUIManager& getInstance() { return Singleton<GUIManager>::getInstance(); } // tolua_export
Note: See TracChangeset
for help on using the changeset viewer.