Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:WindowClearAnchors

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

Removes all anchors from a window.

WindowClearAnchors(windowName)

Arguments

windowName
string – Name of the window.

Returns

Nothing.

Details

  • Every anchor is removed, whether it was added with WindowAddAnchor or came from the window's XML.
  • After removing the anchors, the client sets the window's offset from its parent to (0, 0). The window moves to the top-left corner of its parent until it is anchored or positioned again. The client may shift this position to keep the window on screen (see WindowIsSticky).
  • The usual pattern is to clear the anchors and then add new ones straight away.

Errors

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

Example

Moving a dialog by rebuilding its first anchor, from easystem_dialogmanager/source/dialogmanager.lua:

local point, relativePoint, relativeTo, xoffs, yoffs = WindowGetAnchor( windowName, 1 )
xoffs = dialog.dialogPosition.xOffset
yoffs = dialog.dialogPosition.yOffset
WindowClearAnchors( windowName )
WindowAddAnchor( windowName, point, relativeTo, relativePoint, xoffs, yoffs )

See also