Datatype · Userdata

Category

userdata

Category proxy returned by Tab:add_category. Groups Controls under a collapsible section. Each add_* method appends a control and returns its proxy. Becomes a stale proxy if the owning tab or category is destroyed; further calls raise tab no longer exists or category ... no longer exists.

Fields

NameTypeDescription
add_button(label: string, callback: (() -> ())?) -> Control

Appends a clickable button. The callback fires on each press.

add_color(label: string, default: { number }?, callback: ((rgba: { number }) -> ())?) -> Control

Appends an RGBA colour picker. default is positional {r, g, b, a} with each component in [0, 1]. The callback fires with the new {r, g, b, a} on change.

add_dropdown(label: string, options: { string }, default: number?, callback: ((index: number) -> ())?) -> Control

Appends a dropdown. Non-string entries in options are dropped silently. default is a 0-based index (default 0). The callback fires with the new index on change.

add_input(label: string, default: string?, max_length: number?, callback: ((value: string) -> ())?) -> Control

Appends a single-line text field. max_length caps the input buffer (default 256). The callback fires with the new string on change.

add_keybind(label: string, default_key: number?, mode: number?, callback: ((key: number) -> ())?) -> Control

Appends a keybind picker. default_key is the initial key code (default 0). mode selects the activation behaviour (default 0). The callback fires with the new key code on change.

add_label(text: string) -> Control

Appends a static text label. Use :set(text) on the returned Control to update the displayed string.

add_separator() -> Control

Appends a horizontal divider with no value or callback.

add_slider(label: string, min: number, max: number, default: number?, is_int: boolean?, callback: ((value: number) -> ())?) -> Control

Appends a slider. When is_int is true the control is a SliderInt; otherwise SliderFloat. The callback fires with the new value on change.

add_toggle(label: string, default: boolean?, callback: ((value: boolean) -> ())?) -> Control

Appends a boolean toggle. The callback fires with the new state on change.