ui.Card / ui.Popup
Control builders on ui.Card and ui.Popup; each returns a ui.Control.
Methods
card:checkbox
card:checkbox(label [, default=false] [, on_change]) -> ui.Control| Name | Type | Description |
|---|---|---|
| label | string | Shown text and save key. |
| defaultoptional | boolean | Any truthy value means on. Default false. |
| on_changeoptional | function(value: boolean) | Called on user toggle. |
On/off toggle, saved and bindable.
Returns get() returns boolean
Builders raise an error on a stale (reloaded) card handle.
card:slider_int
card:slider_int(label, default, min, max [, on_change]) -> ui.Control| Name | Type | Description |
|---|---|---|
| label | string | Shown text and save key. |
| default | integer | Clamped to min to max. |
| min | number | |
| max | number | |
| on_changeoptional | function(value: integer) | Called on user drag. |
Whole-number slider, saved and bindable.
Returns get() returns integer
A fractional default raises an error.
card:slider_float
card:slider_float(label, default, min, max [, on_change]) -> ui.Control| Name | Type | Description |
|---|---|---|
| label | string | Shown text and save key. |
| default | number | Clamped to min to max. |
| min | number | |
| max | number | |
| on_changeoptional | function(value: number) | Called on user drag. |
Decimal slider shown with 2 decimals, saved and bindable.
Returns get() returns number
card:combo
card:combo(label, items [, default_index=1] [, on_change]) -> ui.Control| Name | Type | Description |
|---|---|---|
| label | string | Shown text and save key. |
| items | table | Array of option strings. |
| default_indexoptional | integer | 1-based, clamped to the list. Default 1. |
| on_changeoptional | function(index: integer) | Gets the new 1-based index. |
Single-choice dropdown, saved; binds cycle or set it.
Returns get() returns 1-based index
A non-string item raises an error and adds nothing.
card:color
card:color(label [, default] [, on_change]) -> ui.Control| Name | Type | Description |
|---|---|---|
| label | string | Shown text and save key. |
| defaultoptional | table | {r,g,b[,a]}, 0 to 255. Default white {255,255,255,255}. |
| on_changeoptional | function(color: table) | Gets the new {r,g,b,a} table. |
Colour picker with alpha, saved per script.
Returns get() returns {r,g,b,a} 0 to 255
Callback goes third: card:color("x", nil, fn).
card:button
card:button(label [, on_click]) -> ui.Control| Name | Type | Description |
|---|---|---|
| label | string | Button caption. |
| on_clickoptional | function() | Called on click. |
Full-width button; control:same_line() shares a row.
Returns get() returns nil
card:keybind
card:keybind(label [, default_vk=0] [, mode="hold"] [, on_change]) -> ui.Control| Name | Type | Description |
|---|---|---|
| label | string | Shown text and save key. |
| default_vkoptional | integer | string | Key code or name; 0 = unbound. Default 0. |
| modeoptional | string | "hold", "toggle" or "always"; else hold. Default "hold". |
| on_changeoptional | function(vk: integer) | On rebind or clear, not press. |
Key-binding row: click to capture, right-click to clear.
Returns get() vk code, :active() state
- Held only while the game has focus and no text input.
- Rebinding resets toggle state to off.
card:hotkey
card:hotkey(label [, default_vk=0] [, on_change]) -> ui.Control| Name | Type | Description |
|---|---|---|
| label | string | Shown text and save key. |
| default_vkoptional | integer | string | Key code or name; 0 = unbound. Default 0. |
| on_changeoptional | function(vk: integer) | On rebind or clear. |
Toggle keybind: each press flips :active().
Returns get() vk code, :active() toggle
card:multiselect
card:multiselect(label, items [, defaults] [, on_change]) -> ui.Control| Name | Type | Description |
|---|---|---|
| label | string | Shown text and save key. |
| items | table | Option strings; first 32 used. |
| defaultsoptional | table | One boolean per item. Default nothing selected. |
| on_changeoptional | function(selected: table) | Boolean array; may replace defaults. |
Dropdown with any number of items ticked, saved per script.
Returns get() returns boolean per item
A non-string item in the first 32 raises an error.
card:text_input
card:text_input(label [, default=""] [, on_change]) -> ui.Control| Name | Type | Description |
|---|---|---|
| label | string | Shown text and save key. |
| defaultoptional | string | Default "". |
| on_changeoptional | function(text: string) | Called on every edit. |
Single-line text field, saved per script.
Returns get() returns string
Max 1023 characters; line breaks save as spaces.
card:label
card:label(text [, color]) -> ui.Control| Name | Type | Description |
|---|---|---|
| text | string | Small dim hint, wrapped. |
| coloroptional | integer | table | draw.color() or {r, g, b, a}. Default dim. |
Line of hint text; change it with control:set_label().
Returns get() returns nil
card:separator
card:separator() -> ui.ControlThin horizontal rule between rows.
Returns get() returns nil