API:WindowSetResizing
From RoR Wiki
UI Lua API · Window functions
Version: WAR 1.4.8
Starts or stops resizing a window with the mouse.
WindowSetResizing(windowName, resizing, point, keepAspectRatio)
Arguments
- windowName
string– Name of the window.- resizing
boolean–trueto start resizing,falseto stop.- point
string– The edge or corner the resize works on:"topleft","topright","bottomleft","bottomright","top","bottom","left"or"right". Ignored whenresizingisfalse.- keepAspectRatio
boolean–trueto keep the window's width-to-height ratio while resizing.
Returns
Nothing.
Details
keepAspectRatiois stored on every call, also whenresizingisfalse.- With
resizing = true, the client records the current mouse position and starts the resize frompoint. "center"and unknown names do not start a resize; WindowGetResizing then returnsfalse.- With
resizing = false, any running resize ends. The stock UI passes""aspointin that case. - Both flags must be real booleans. Passing
nilor a number raises an Invalid Parameters error.
Errors
Error in function call 'WindowSetResizing': Window %s does not existError in function call 'WindowSetResizing': Window %s is currently locked and may not be modified from lua. ...
This check never triggers in the current client. See WindowSetShowing.
Example
Starting a resize in WindowUtils.BeginResize, from easystem_windowutils/source/windowutils.lua:
WindowAddAnchor( "ResizingWindowFrame", anchorCorner, windowName, anchorCorner, 0, 0 ) WindowSetResizing( "ResizingWindowFrame", true, anchorCorner, false ); WindowSetShowing( "ResizingWindowFrame", true )
Ending it in WindowUtils.EndResize, same file:
WindowSetResizing( "ResizingWindowFrame", false, "", false );
