A draggable, titled window and the supported way to build movable tool panels. Parent the
window's widgets into content (its origin sits just below the title bar) and they move with
the window for free: they are plain display-list children, so layouts are written once in
window-local coordinates and never touched again on drag.
The window itself is a passive, blocking surface; the interactive title bar is a child, so
widgets inside content receive the pointer normally. Pressing anywhere raises the window to
the front and makes it the active window (its bar renders brighter). Options: draggable
(the bar drags with viewport clamping), resizable (a bottom-right grip, honouring
minWidth/minHeight), closable (an X that fires onClose or disposes), and collapsible
(a chevron that rolls the body up to just the bar). The body is a UIFill (the PANEL slot by
default) with a 1px outline and a PANEL3 title band, so it follows theme swaps like UIPanel.
Static variables
staticread onlyactiveWindow:UIWindow = null
The active (front-most, most recently pressed) window, or null.
Constructor
Variables
closable:Bool = false
Shows a close (X) button that fires onClose, or disposes the window when it is null.
collapsible:Bool = false
Shows a collapse (chevron) button that rolls the body up to just the title bar.
finalcontent:Sprite
Parent the window's widgets here; local (0, 0) is the body's top-left below the bar.
onMoved:(x:Float, y:Float) ‑> Void = null
Fired after the user drags the window, with the new x/y (already applied).
onResized:(w:Float, h:Float) ‑> Void = null
Fired after the user resizes the window, with the new w/h (already applied).
Methods
localize(key:String, fallback:String):Void
Switches the title to a localized string.
Parameters:
key | the translation key |
|---|---|
fallback | the source-language text |