Window
Classes
Class: Window
Extends Widget
A
Windowwidget represents a UI window with optional modal behavior, title text and styling, and layer management. It supports closing via the Escape key, custom title insets, and modal backgrounds.Dependencies:
- EmptyWidget used for the
modalBackgroundWindowfield.- TextStyle used for the
titleStylefield.
Field: titleStyle
TextStyle
The text style applied to the window’s title.
Field: modalBackgroundWindow
EmptyWidget
Not needed for the method
SetWindowModal.
Method: SetWindowModal
(method) Window:SetWindowModal(enable: boolean)
Enables or disables modal behavior for the Window.
@param
enable—trueto make the Window modal,falseto disable. (default:false)
Method: SetUILayer
(method) Window:SetUILayer(layerName: "background"|"dialog"|"game"|"hud"|"normal"...(+3))
Sets the UI layer for the Window. If the window is a child then the layer is relative to the parents layer.
@param
layerName— The name of the UI layer. (default:"normal")-- Widgets with layers of the same level and parent can overlap based on focus. layerName: | "background" -- Layer 0 (invisible) | "game" -- Layer 1 -> "normal" -- Layer 2 (default) | "hud" -- Layer 3 | "questdirecting" -- Layer 4 | "dialog" -- Layer 5 | "tooltip" -- Layer 6 | "system" -- Layer 7
Method: SetTitleInset
(method) Window:SetTitleInset(left: number, top: number, right: number, bottom: number)
Sets the inset for the title of the Window.
@param
left— The left inset.@param
top— The top inset.@param
right— The right inset.@param
bottom— The bottom inset.
Method: SetTitleText
(method) Window:SetTitleText(title: string)
Sets the title text for the Window.
@param
title— The title text to set.
Method: SetCloseOnEscape
(method) Window:SetCloseOnEscape(escape: boolean)
Enables or disables closing the Window when the Escape key is pressed.
@param
escape—trueto enable close on Escape,falseto disable. (default:false)