Input
Input is the set of editor controls. Each control is two-way bound to a single settable value: it
reads that value to display and writes back to it when the user edits, so there is no separate change
handler. An Input is just the control; the label is up to you (use Content.Label or
Content.Title beside it).
The basic fields cover the common cases: Input.Text and Input.Number are
editable boxes, Input.ReadOnly shows a value without editing it, and
Input.Checkbox toggles a boolean. Sliders under Input.Slider drag a value
within optional bounds, while ranges under Input.Range edit the min and max bounds
themselves; both come in Float, Int and Vector2 to
Vector4 variants that lay out one box per component. For picking from a fixed set of
choices there is Input.Dropdown and Input.Radio, each declaring its choices
with an inner Option. Finally Input.Code.Glsl is a code editor bound to a
source string.
Contents
Functions
- Input.Checkbox
- Input.Code.Glsl
- Input.Dropdown
- Input.Dropdown.Option
- Input.Number
- Input.Radio
- Input.Radio.Option
- Input.Range.Float
- Input.Range.Int
- Input.Range.Vector2
- Input.Range.Vector3
- Input.Range.Vector4
- Input.ReadOnly
- Input.Slider.Float
- Input.Slider.Int
- Input.Slider.Vector2
- Input.Slider.Vector3
- Input.Slider.Vector4
- Input.Text
Functions
Input.Checkbox
A checkbox bound to a settable boolean.
Parameters
| Name | Type | Description |
|---|---|---|
value | settable boolean | The boolean binding. The box reflects it and writes its checked state back on change. |
Example
Content.Label("Visible");
Input.Checkbox(visible);Input.Code.Glsl
A GLSL code editor bound two-way to a settable source string.
Parameters
| Name | Type | Description |
|---|---|---|
source | settable text | The GLSL source binding to read and write. A null slot shows blank and is filled on first edit. |
Example
Content.Label("Shader");
Input.Code.Glsl(source);Input.Dropdown
A select bound to a selected value; its body declares the choices with Dropdown.Option.
Parameters
| Name | Type | Description |
|---|---|---|
selected | settable value | The binding for the current choice; the select writes the chosen value back on change. |
options | function | A closure declaring the choices, each with Dropdown.Option. It captures selected by closure. |
Example
Input.Dropdown(mode, () => {
Input.Dropdown.Option("add", "Add");
Input.Dropdown.Option("mix", "Mix");
});Input.Dropdown.Option
Declares one choice inside a Dropdown body; marks itself selected while it matches.
Parameters
| Name | Type | Description |
|---|---|---|
value | value | The value this option selects when chosen. |
label | text | The option's visible text. |
Example
Input.Dropdown.Option("add", "Add");Input.Number
A numeric field bound to a settable real number.
Parameters
| Name | Type | Description |
|---|---|---|
value | settable number | The real binding to edit. Typed text is parsed and only written when it is a valid number. |
Example
Content.Label("Speed");
Input.Number(speed);Input.Radio
A one-of-N radio group bound to a selected value; its body declares the choices with Radio.Option.
Parameters
| Name | Type | Description |
|---|---|---|
selected | settable value | The binding for the current choice; an option's click writes its native value back. |
options | function | A closure declaring the choices, each with Radio.Option. It captures selected by closure. |
Example
Input.Radio(mode, () => {
Input.Radio.Option("add", "Add");
Input.Radio.Option("mix", "Mix");
});Input.Radio.Option
Declares one radio choice inside a Radio body; writes its native value when clicked.
Parameters
| Name | Type | Description |
|---|---|---|
value | value | The value this radio selects when clicked; its native type is preserved. |
label | text | The radio's visible text. |
Example
Input.Radio.Option("add", "Add");Input.Range.Float
Edits the minimum and maximum bounds of a real range, the complement of Slider.
Parameters
| Name | Type | Description |
|---|---|---|
minimum | settable number | The low bound to edit. |
maximum | settable number | The high bound to edit. Sharing these with a Slider keeps the two in sync. |
Example
Content.Label("Range");
Input.Range.Float(low, high);Input.Range.Int
Edits the minimum and maximum bounds of an integer range.
Parameters
| Name | Type | Description |
|---|---|---|
minimum | settable integer | The low bound to edit. |
maximum | settable integer | The high bound to edit. |
Example
Content.Label("Steps");
Input.Range.Int(low, high);Input.Range.Vector2
Per-component min and max editors for a two-component vector range.
Parameters
| Name | Type | Description |
|---|---|---|
minimum | settable Vector2 | The low bounds; one Range.Float per component of x and y. |
maximum | settable Vector2 | The high bounds, per component. |
Example
Content.Label("Bounds");
Input.Range.Vector2(low, high);Input.Range.Vector3
Per-component min and max editors for a three-component vector range.
Parameters
| Name | Type | Description |
|---|---|---|
minimum | settable Vector3 | The low bounds; one Range.Float per component of x, y and z. |
maximum | settable Vector3 | The high bounds, per component. |
Example
Content.Label("Bounds");
Input.Range.Vector3(low, high);Input.Range.Vector4
Per-component min and max editors for a four-component vector range.
Parameters
| Name | Type | Description |
|---|---|---|
minimum | settable Vector4 | The low bounds; one Range.Float per component of x, y, z and w. |
maximum | settable Vector4 | The high bounds, per component. |
Example
Content.Label("Bounds");
Input.Range.Vector4(low, high);Input.ReadOnly
Shows a bound value as static text that cannot be edited.
Parameters
| Name | Type | Description |
|---|---|---|
value | any | The value to display. It is shown as text and reflects the binding, but the user cannot change it. |
Example
Content.Label("Total");
Input.ReadOnly(total);Input.Slider.Float
A slider for a real value within an optional min and max, with a numeric readout.
Parameters
| Name | Type | Description |
|---|---|---|
value | settable number | The real binding the slider moves. |
optionalMin | number or null | The low bound, or null for an unbounded axis. |
optionalMax | number or null | The high bound, or null for an unbounded axis. The drag track shows only when both bounds are given; the numeric box is always shown. |
Example
Content.Label("Opacity");
Input.Slider.Float(opacity, 0, 1);Input.Slider.Int
A slider for an integer value within an optional min and max, stepping by one.
Parameters
| Name | Type | Description |
|---|---|---|
value | settable integer | The integer binding the slider moves. |
optionalMin | integer or null | The low bound, or null for an unbounded axis. |
optionalMax | integer or null | The high bound, or null for an unbounded axis. The drag track shows only when both bounds are given. |
Example
Content.Label("Count");
Input.Slider.Int(count, 1, 10);Input.Slider.Vector2
Per-component sliders for a two-component vector.
Parameters
| Name | Type | Description |
|---|---|---|
value | settable Vector2 | The vector binding; one Slider.Float is drawn for each of x and y. |
optionalMin | Vector2 or null | Per-component low bounds, or null for unbounded. |
optionalMax | Vector2 or null | Per-component high bounds, or null for unbounded. |
Example
Content.Label("Offset");
Input.Slider.Vector2(offset, low, high);Input.Slider.Vector3
Per-component sliders for a three-component vector.
Parameters
| Name | Type | Description |
|---|---|---|
value | settable Vector3 | The vector binding; one Slider.Float is drawn for each of x, y and z. |
optionalMin | Vector3 or null | Per-component low bounds, or null for unbounded. |
optionalMax | Vector3 or null | Per-component high bounds, or null for unbounded. |
Example
Content.Label("Position");
Input.Slider.Vector3(position, low, high);Input.Slider.Vector4
Per-component sliders for a four-component vector.
Parameters
| Name | Type | Description |
|---|---|---|
value | settable Vector4 | The vector binding; one Slider.Float is drawn for each of x, y, z and w. |
optionalMin | Vector4 or null | Per-component low bounds, or null for unbounded. |
optionalMax | Vector4 or null | Per-component high bounds, or null for unbounded. |
Example
Content.Label("Colour");
Input.Slider.Vector4(colour, low, high);Input.Text
A single-line text field bound two-way to a settable string.
Parameters
| Name | Type | Description |
|---|---|---|
value | settable text | The string binding to read and write. A null slot shows blank and is filled on first edit. |
Example
Content.Label("Name");
Input.Text(name);