API:WindowSetScale
From RoR Wiki
UI Lua API · Window functions
Version: WAR 1.4.8
Sets the scale of a window and all of its descendants.
WindowSetScale(windowName, scale)
Arguments
- windowName
string– Name of the window.- scale
number– New absolute scale. 1 means unscaled.
Returns
Nothing.
Details
- The window and every descendant get exactly this scale. Child windows do not keep a scale of their own relative to the parent.
- The dimensions (WindowGetDimensions) do not change; the size on screen is the dimensions multiplied by the new scale.
- If the new scale differs from the window's current scale only by a very small amount, the call does nothing.
- A running scale animation overwrites the value on its next frame. Stop it first with WindowStopScaleAnimation.
- The function needs at least two arguments and only reads the last two.
Errors
Error in function call 'WindowSetScale': Window %s does not existError in function call 'WindowSetScale': Window %s is currently locked and may not be modified from lua. ...
This check never triggers in the current client. See WindowSetShowing.
Example
Restoring a window's settings after editing, from easystem_layouteditor/source/layoutframe.lua:
-- Restore the Size WindowSetDimensions( self.m_sourceWindowName, self.m_originalWidth , self.m_originalHeight ) -- Restore the Scale WindowSetScale( self.m_sourceWindowName, self.m_originalScale )
