Modules · Interface

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

Functions

Input.Checkbox

A checkbox bound to a settable boolean.

Parameters

NameTypeDescription
valuesettable booleanThe boolean binding. The box reflects it and writes its checked state back on change.

Example

Content.Label("Visible");
Input.Checkbox(visible);
A checkbox toggling the visible flag

Input.Code.Glsl

A GLSL code editor bound two-way to a settable source string.

Parameters

NameTypeDescription
sourcesettable textThe 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);
A GLSL editor bound to the source string

Input.Dropdown

A select bound to a selected value; its body declares the choices with Dropdown.Option.

Parameters

NameTypeDescription
selectedsettable valueThe binding for the current choice; the select writes the chosen value back on change.
optionsfunctionA 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");
});
A select bound to the mode value with two choices

Input.Dropdown.Option

Declares one choice inside a Dropdown body; marks itself selected while it matches.

Parameters

NameTypeDescription
valuevalueThe value this option selects when chosen.
labeltextThe option's visible text.

Example

Input.Dropdown.Option("add", "Add");
One choice: value "add" shown as "Add"

Input.Number

A numeric field bound to a settable real number.

Parameters

NameTypeDescription
valuesettable numberThe real binding to edit. Typed text is parsed and only written when it is a valid number.

Example

Content.Label("Speed");
Input.Number(speed);
A box that edits the speed number

Input.Radio

A one-of-N radio group bound to a selected value; its body declares the choices with Radio.Option.

Parameters

NameTypeDescription
selectedsettable valueThe binding for the current choice; an option's click writes its native value back.
optionsfunctionA 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");
});
A radio group bound to the mode value

Input.Radio.Option

Declares one radio choice inside a Radio body; writes its native value when clicked.

Parameters

NameTypeDescription
valuevalueThe value this radio selects when clicked; its native type is preserved.
labeltextThe radio's visible text.

Example

Input.Radio.Option("add", "Add");
One radio: value "add" shown as "Add"

Input.Range.Float

Edits the minimum and maximum bounds of a real range, the complement of Slider.

Parameters

NameTypeDescription
minimumsettable numberThe low bound to edit.
maximumsettable numberThe high bound to edit. Sharing these with a Slider keeps the two in sync.

Example

Content.Label("Range");
Input.Range.Float(low, high);
Two boxes editing the low and high bounds

Input.Range.Int

Edits the minimum and maximum bounds of an integer range.

Parameters

NameTypeDescription
minimumsettable integerThe low bound to edit.
maximumsettable integerThe high bound to edit.

Example

Content.Label("Steps");
Input.Range.Int(low, high);
Two whole-number boxes for a range

Input.Range.Vector2

Per-component min and max editors for a two-component vector range.

Parameters

NameTypeDescription
minimumsettable Vector2The low bounds; one Range.Float per component of x and y.
maximumsettable Vector2The high bounds, per component.

Example

Content.Label("Bounds");
Input.Range.Vector2(low, high);
Min and max boxes per component of a 2D range

Input.Range.Vector3

Per-component min and max editors for a three-component vector range.

Parameters

NameTypeDescription
minimumsettable Vector3The low bounds; one Range.Float per component of x, y and z.
maximumsettable Vector3The high bounds, per component.

Example

Content.Label("Bounds");
Input.Range.Vector3(low, high);
Min and max boxes per component of a 3D range

Input.Range.Vector4

Per-component min and max editors for a four-component vector range.

Parameters

NameTypeDescription
minimumsettable Vector4The low bounds; one Range.Float per component of x, y, z and w.
maximumsettable Vector4The high bounds, per component.

Example

Content.Label("Bounds");
Input.Range.Vector4(low, high);
Min and max boxes per component of a 4D range

Input.ReadOnly

Shows a bound value as static text that cannot be edited.

Parameters

NameTypeDescription
valueanyThe 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);
The total shown but not editable

Input.Slider.Float

A slider for a real value within an optional min and max, with a numeric readout.

Parameters

NameTypeDescription
valuesettable numberThe real binding the slider moves.
optionalMinnumber or nullThe low bound, or null for an unbounded axis.
optionalMaxnumber or nullThe 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);
A 0 to 1 slider with a numeric readout

Input.Slider.Int

A slider for an integer value within an optional min and max, stepping by one.

Parameters

NameTypeDescription
valuesettable integerThe integer binding the slider moves.
optionalMininteger or nullThe low bound, or null for an unbounded axis.
optionalMaxinteger or nullThe 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);
A whole-number slider from 1 to 10

Input.Slider.Vector2

Per-component sliders for a two-component vector.

Parameters

NameTypeDescription
valuesettable Vector2The vector binding; one Slider.Float is drawn for each of x and y.
optionalMinVector2 or nullPer-component low bounds, or null for unbounded.
optionalMaxVector2 or nullPer-component high bounds, or null for unbounded.

Example

Content.Label("Offset");
Input.Slider.Vector2(offset, low, high);
A slider per component for a 2D offset

Input.Slider.Vector3

Per-component sliders for a three-component vector.

Parameters

NameTypeDescription
valuesettable Vector3The vector binding; one Slider.Float is drawn for each of x, y and z.
optionalMinVector3 or nullPer-component low bounds, or null for unbounded.
optionalMaxVector3 or nullPer-component high bounds, or null for unbounded.

Example

Content.Label("Position");
Input.Slider.Vector3(position, low, high);
Three sliders for a 3D position

Input.Slider.Vector4

Per-component sliders for a four-component vector.

Parameters

NameTypeDescription
valuesettable Vector4The vector binding; one Slider.Float is drawn for each of x, y, z and w.
optionalMinVector4 or nullPer-component low bounds, or null for unbounded.
optionalMaxVector4 or nullPer-component high bounds, or null for unbounded.

Example

Content.Label("Colour");
Input.Slider.Vector4(colour, low, high);
Four sliders for a 4D value

Input.Text

A single-line text field bound two-way to a settable string.

Parameters

NameTypeDescription
valuesettable textThe string binding to read and write. A null slot shows blank and is filled on first edit.

Example

Content.Label("Name");
Input.Text(name);
A text box that reads and writes the name binding