Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:WindowSetMoving

From RoR Wiki
Revision as of 19:51, 16 October 2026 by Maintenance script (talk | contribs) (UI Lua API import (WAR 1.4.8))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

UI Lua API · Window functions
Version: WAR 1.4.8

Starts or stops moving a window with the mouse.

WindowSetMoving(windowName, moving)

Arguments

windowName
string – Name of the window.
moving
boolean – true to start moving the window, false to stop.

Returns

Nothing.

Details

  • This is what the client does itself when the left mouse button is pressed on a movable window. Calling it with true works even if the window is not movable (see WindowSetMovable).
  • When a move starts, the client records the current mouse position.
  • If the window is already in the requested state, nothing happens.
  • When the state changes, the client can call the window's OnSetMoving core event handler with the new state (see WindowRegisterCoreEventHandler).
  • Hiding a window that is being moved ends the move.
  • moving must be a real boolean. Passing nil or a number raises an Invalid Parameters error.
  • The function needs at least two arguments and only reads the last two.

Errors

  • Error in function call 'WindowSetMoving': Window %s does not exist
  • Error in function call 'WindowSetMoving': Window %s is currently locked and may not be modified from lua. ...
    This check never triggers in the current client. See WindowSetShowing.

Example

The layout editor starting and ending a move, from easystem_layouteditor/source/layoutcontrolframe.lua:

function LayoutControlFrame:BeginMoving()
    -- ...
    self.m_moving = true
    WindowSetMoving( self:GetName(), true )
    -- ...
end

function LayoutControlFrame:EndMoving()
    -- ...
    self.m_moving = false
    WindowSetMoving( self:GetName(), false )
    -- ...
end

See also