A filled surface: chrome bands, cards, placeholders. Non-interactive but blocking by default (children stay interactive, pointer hits never fall through). corner rounds the fill; the four border* flags draw 1px themed edges and outline draws a full 1px frame.

Themed by default: fill is a UIFill — a theme slot (PANEL unless you pass another) that re-reads the palette every render and follows theme swaps, or any ARGB colour literal (new UIPanel(w, h, 0xFF1E1E21)) for the rare fixed surface that shouldn't.

Constructor

@:value({ blocking : true, fill : PANEL })new(width:Float, height:Float, fill:UIFill = PANEL, blocking:Bool = true)

Parameters:

width

layout width

height

layout height

fill

a theme slot (follows theme swaps) or a fixed ARGB colour

blocking

true swallows pointer hits (children stay interactive)

Variables

@:value(false)borderBottom:Bool = false

@:value(false)borderLeft:Bool = false

@:value(false)borderRight:Bool = false

@:value(false)borderTop:Bool = false

@:value(0)corner:Float = 0

Corner radius in scaled pixels (0 = square).

@:value(PANEL)fill:UIFill = PANEL

What the panel paints: a theme slot (follows theme swaps) or a fixed ARGB colour.

@:value(null)gradient:UIGradient = null

Optional gradient fill; overrides fill when set (fixed colours — see UIGradient).

@:value(false)outline:Bool = false

Full 1px frame (cards).

Methods

Inherited Variables

Defined by UIComponent

@:value(true)enabled:Bool = true

Disabled widgets ignore the pointer and typically render dimmed.

@:value(0)read onlyh:Float = 0

Layout height in UI units.

@:value(MouseCursor.BUTTON)hoverCursor:MouseCursor = MouseCursor.BUTTON

Native cursor while hovering (interactive widgets; null keeps the arrow).

@:value(false)read onlyhovered:Bool = false

true while the cursor is over this widget.

@:value(false)longPressable:Bool = false

Opts a subclass that overrides onRightPress (without setting onRightClick) into long-press-as-right-click on touch. Widgets with onRightClick set are included automatically.

@:value(null)onClick:() ‑> Void = null

Fired on a completed click (press + release on this widget). Requires an interactive widget.

@:value(null)onHover:() ‑> Void = null

Fired when the cursor first enters this widget (hover-driven descriptions/previews). Interactive widgets only.

@:value(null)onRightClick:() ‑> Void = null

Fired on a right mouse press over this widget (context menus). Only interactive widgets receive pointer events, so this never fires on passive widgets like UILabel/UIPanel — attach it to a UIButton (or another interactive widget) instead. On touch, a long-press fires the same path (see UIRoot.longPressMs).

@:value(false)read onlypressed:Bool = false

true while a press that started here is held.

@:value(null)tooltip:String = null

Optional tooltip text (already-localized or a fixed string).

@:value(null)tooltipShortcut:String = null

Optional right-aligned shortcut hint rendered in the tooltip.

@:value(0)read onlyw:Float = 0

Layout width in UI units (independent of DisplayObject's content-derived width).

Inherited Methods

Defined by UIComponent

dispose():Void

Tears the widget down: listeners, pointer references, children, parent link.

invalidate():Void

Schedules a repaint for the next frame (cheap; deduplicated).

resize(width:Float, height:Float):Void

Sets the layout size and repaints when it changed.

Parameters:

width

the new layout width in UI units

height

the new layout height in UI units