Changeset 11809
- Timestamp:
- Feb 24, 2018, 4:58:39 PM (7 years ago)
- Location:
- code/branches/cegui0.8_ogre1.9
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cegui0.8_ogre1.9/data/gui/scripts/GUITools.lua
r11799 r11809 31 31 32 32 local lookAndFeel = CEGUI.WidgetLookManager:getSingleton():getWidgetLook(window:getLookNFeel()) 33 local height = window:getFont():getLineSpacing() + window:getUnclippedOuterRect():get():getHeight() - lookAndFeel:getNamedArea("WithFrameTextRenderArea"):getArea():getPixelRect(window):getHeight() 34 local width = window:getFont():getTextExtent(window:getText()) + window:getUnclippedOuterRect():get():getWidth() - lookAndFeel:getNamedArea("WithFrameTextRenderArea"):getArea():getPixelRect(window):getWidth() 33 34 local lineSpacing = window:getFont():getLineSpacing() 35 --local textExtent = window:getFont():getTextExtent(window:getText()) 36 local textExtent = orxonox.GUIManager:getFontTextExtent(window:getFont(), window:getText()) -- workaround for bug in cegui lua scripts 37 38 local height = lineSpacing + window:getUnclippedOuterRect():get():getHeight() - lookAndFeel:getNamedArea("WithFrameTextRenderArea"):getArea():getPixelRect(window):getHeight() 39 local width = textExtent + window:getUnclippedOuterRect():get():getWidth() - lookAndFeel:getNamedArea("WithFrameTextRenderArea"):getArea():getPixelRect(window):getWidth() 35 40 36 41 table.insert(size, height) -
code/branches/cegui0.8_ogre1.9/src/libraries/core/GUIManager.cc
r11795 r11809 972 972 } 973 973 974 /*static*/ float GUIManager::getFontTextExtent(const CEGUI::Font* font, const std::string& text, float x_scale) 975 { 976 return font->getTextExtent(text, x_scale); 977 } 974 978 } -
code/branches/cegui0.8_ogre1.9/src/libraries/core/GUIManager.h
r11071 r11809 143 143 static void setItemTooltipsEnabledHelper(CEGUI::Listbox* listbox, bool enabled); // tolua_export 144 144 static void addFontHelper(const std::string& name, int size, const std::string& fontName); // tolua_export 145 static float getFontTextExtent(const CEGUI::Font* font, const std::string& text, float x_scale = 1.0f); // tolua_export 145 146 146 147 static GUIManager& getInstance() { return Singleton<GUIManager>::getInstance(); } // tolua_export
Note: See TracChangeset
for help on using the changeset viewer.