Skip to content

Components

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

FieldScript nameKindDefaultWhat it does
ActionactiontextemptyReported when this slider moves.
Valuevaluenumber, step 0.011The current value, between min and max.
Minminnumber0Value at the left-hand end of the slider.
Maxmaxnumber1Value at the right-hand end of the slider.
Stepstepnumber, at least 00The smallest amount the value can change by, and how far one arrow press moves it. Zero allows any value.
InteractiveinteractivecheckboxonOff makes this a read-only bar.
Fillfillcolour#a6a6b8Colour of the filled part.
Tracktrackcolour#26262eColour of the empty part.
Textures
Fill Texturefill_textureassetnoneTexture drawn over the filled part. Leave it unset to keep a flat colour.
Track Texturetrack_textureassetnoneTexture drawn over the whole track. Leave it unset to keep a flat colour.
Borderbordernumber, at least 00Nine-slice border shared by both textures.