Slider
A value dragged between a minimum and a maximum, reporting a named action as it moves: a volume control, a difficulty scale. Turn Interactive off and it becomes a read-only bar instead — a health or stamina meter. Goes under a Canvas.
On this page
Add it
+ Add node → Slider creates a node with it already on. Already have a node for it? Add component → SliderComponent.
From a script
A script on the same node writes these fields by name. SliderComponent is the name to pass.
rgs
set_text("SliderComponent", "action", "");
set_number("SliderComponent", "value", 1.0);
set_number("SliderComponent", "min", 0.0);
set_number("SliderComponent", "max", 1.0);
set_number("SliderComponent", "step", 0.0);
set_flag("SliderComponent", "interactive", true);
set_colour("SliderComponent", "fill", vec4(0.65, 0.65, 0.72, 1.0));
set_colour("SliderComponent", "track", vec4(0.15, 0.15, 0.18, 1.0));
set_number("SliderComponent", "border", 0.0); Fields
| Field | Script name | Kind | Default | What it does |
|---|---|---|---|---|
| Action | action | text | empty | Reported when this slider moves. |
| Value | value | number, step 0.01 | 1 | The current value, between min and max. |
| Min | min | number | 0 | Value at the left-hand end of the slider. |
| Max | max | number | 1 | Value at the right-hand end of the slider. |
| Step | step | number, at least 0 | 0 | The smallest amount the value can change by, and how far one arrow press moves it. Zero allows any value. |
| Interactive | interactive | checkbox | on | Off makes this a read-only bar. |
| Fill | fill | colour | #a6a6b8 | Colour of the filled part. |
| Track | track | colour | #26262e | Colour of the empty part. |
| Textures | ||||
| Fill Texture | fill_texture | asset | none | Texture drawn over the filled part. Leave it unset to keep a flat colour. |
| Track Texture | track_texture | asset | none | Texture drawn over the whole track. Leave it unset to keep a flat colour. |
| Border | border | number, at least 0 | 0 | Nine-slice border shared by both textures. |