Skip to content

Return of Reckoning

Wiki

RoR Wiki

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 – true to start resizing, false to stop.
point
string – The edge or corner the resize works on: "topleft", "topright", "bottomleft", "bottomright", "top", "bottom", "left" or "right". Ignored when resizing is false.
keepAspectRatio
boolean – true to keep the window's width-to-height ratio while resizing.

Returns

Nothing.

Details

  • keepAspectRatio is stored on every call, also when resizing is false.
  • With resizing = true, the client records the current mouse position and starts the resize from point.
  • "center" and unknown names do not start a resize; WindowGetResizing then returns false.
  • With resizing = false, any running resize ends. The stock UI passes "" as point in that case.
  • Both flags must be real booleans. Passing nil or a number raises an Invalid Parameters error.

Errors

  • Error in function call 'WindowSetResizing': Window %s does not exist
  • Error 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 );

See also