Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 25, 2011, 5:02:13 AM (14 years ago)
Author:
rgrieder
Message:

Restored compatibility of our Lua code with CEGUI:
Some functions were renamed. I've done so too and added an alias at initialisation for older versions.
Caution: Credits and Quest menu don't yet work because CEGUI 0.7 has less Font functionality.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/kicklib/data/gui/scripts/GUITools.lua

    r7922 r7961  
    3131
    3232    local lookAndFeel = CEGUI.WidgetLookManager:getSingleton():getWidgetLook(window:getLookNFeel())
    33     local height = window:getFont():getLineSpacing() + window:getUnclippedPixelRect():getHeight() - lookAndFeel:getNamedArea("WithFrameTextRenderArea"):getArea():getPixelRect(window):getHeight()
    34     local width =  window:getFont():getTextExtent(window:getText()) + window:getUnclippedPixelRect():getWidth() - lookAndFeel:getNamedArea("WithFrameTextRenderArea"):getArea():getPixelRect(window):getWidth()
     33    local height = window:getFont():getLineSpacing() + window:getUnclippedOuterRect():getHeight() - lookAndFeel:getNamedArea("WithFrameTextRenderArea"):getArea():getPixelRect(window):getHeight()
     34    local width =  window:getFont():getTextExtent(window:getText()) + window:getUnclippedOuterRect():getWidth() - lookAndFeel:getNamedArea("WithFrameTextRenderArea"):getArea():getPixelRect(window):getWidth()
    3535
    3636    table.insert(size, height)
     
    4040
    4141function getScrollingStepSize(window)
    42     local height = window:getUnclippedPixelRect():getHeight()
    43     local maxHeight = CEGUI.System:getSingleton():getGUISheet():getUnclippedPixelRect():getHeight()
     42    local height = window:getUnclippedOuterRect():getHeight()
     43    local maxHeight = CEGUI.System:getSingleton():getGUISheet():getUnclippedOuterRect():getHeight()
    4444    local ratio = height/maxHeight
    4545    return 0.008*ratio/0.3204
     
    4949    local lookAndFeel = CEGUI.WidgetLookManager:getSingleton():getWidgetLook(window:getLookNFeel())
    5050    local formattedArea = lookAndFeel:getNamedArea("WithFrameTextRenderArea"):getArea():getPixelRect(window)
    51     local frameHeight = window:getUnclippedPixelRect():getHeight() - formattedArea:getHeight()
     51    local frameHeight = window:getUnclippedOuterRect():getHeight() - formattedArea:getHeight()
    5252    local lines = window:getFont():getFormattedLineCount(window:getText(), formattedArea, CEGUI.WordWrapLeftAligned)
    5353    local height = lines * window:getFont():getLineSpacing() + frameHeight
Note: See TracChangeset for help on using the changeset viewer.