A clickable button. Variants: default (panel surface), accent (primary action) and
danger (destructive). Hover lightens, press dips; the click fires on press-started
release (see UIComponent).
A button may show a label, a UIIcon, or both: assign icon (or build an icon-only button
with UIButton.icon(...)). The icon may be a built-in glyph (UIIcon.fromGlyph) or an asset —
that is up to the caller. Unless the icon pins its own colorOverride, it follows the button's
foreground tone. A toolbar-style toggle is just accent flipped at runtime.
Static methods
staticicon(icon:UIIcon, size:Float, ?onClick:() ‑> Void):UIButton
Builds a square, icon-only button hosting a UIIcon (glyph- or asset-backed — the caller
decides). A toolbar toggle is just accent flipped at runtime.
Parameters:
icon | the icon to show |
|---|---|
size | the square edge length |
onClick | fired on a completed click |
Returns:
the configured button
Constructor
new(label:String, width:Float, height:Float, ?onClick:() ‑> Void, accent:Bool = false)
Parameters:
label | the button text (raw; use |
|---|---|
width | layout width |
height | layout height |
onClick | fired on a completed click |
accent |
|
Variables
Methods
localize(key:String, fallback:String):Void
Switches the label to a localized string.
Parameters:
key | the translation key |
|---|---|
fallback | the source-language text |