Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:WindowSetLayer

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

Sets the layer a window is drawn on, relative to its siblings.

WindowSetLayer(windowName, layer)

Arguments

windowName
string – Name of the window.
layer
number – New layer. Use one of the Window.Layers constants below.

Returns

Nothing.

Details

  • The client defines these constants:
Constant Value
Window.Layers.BACKGROUND 0
Window.Layers.DEFAULT 1
Window.Layers.SECONDARY 2
Window.Layers.POPUP 3
Window.Layers.OVERLAY 4
  • Layers only order a window against its siblings (windows with the same parent). Siblings on a higher layer are drawn in front.
  • The window is moved in its parent's child list to the front of the siblings on its new layer. Calling the function with the window's current layer therefore also raises it within that layer.
  • layer is truncated to a whole number and stored in one byte, so values outside 0–255 wrap around. The value is not checked against the constants.
  • The function needs at least two arguments and only reads the last two.

Errors

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

Example

From ea_scenariosummarywindow/scenariosummarywindow.lua:

-- Move the window to the overlay layer when in loading mode
if( inLoadingMode ) then
    WindowSetLayer("ScenarioSummaryWindow", Window.Layers.OVERLAY )
    -- ...
else
    WindowSetLayer("ScenarioSummaryWindow", Window.Layers.SECONDARY )
    -- ...
end

See also