Skip to content

Components

Scrollbar

Drives one axis of the Scroll View it names. Its thumb shows how much of the view is on screen and how far it is scrolled, and dragging it scrolls. A Panel on the same node is the track. Retype the name if the view is renamed.

On this page

Add it

+ Add node → Scrollbar creates a node with it already on. Already have a node for it? Add component → ScrollbarComponent.

From a script

A script on the same node writes these fields by name. ScrollbarComponent is the name to pass.

rgs
set_text("ScrollbarComponent", "view", "");
set_number("ScrollbarComponent", "min_thumb", 24.0);
set_colour("ScrollbarComponent", "thumb", vec4(1.0, 1.0, 1.0, 0.6));
set_number("ScrollbarComponent", "border", 0.0);

Fields

FieldScript nameKindDefaultWhat it does
ViewviewtextemptyName of the scroll view this bar drives.
Axisaxisone of Vertical, HorizontalVerticalWhich way the bar runs.
Min Thumbmin_thumbnumber, at least 124Shortest the thumb may get, in UI units.
Thumbthumbcolour#ffffff, 60% opaqueColour of the thumb that shows where the view is scrolled to.
Textures
Thumb Texturethumb_textureassetnoneA picture for the thumb, or nothing for a flat colour.
Borderbordernumber, at least 00How much of each edge of the thumb's picture keeps its size while the middle stretches.