API:WindowSetLayer
From RoR Wiki
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 theWindow.Layersconstants 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.
layeris 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 existError 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
