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
| Field | Script name | Kind | Default | What it does |
|---|---|---|---|---|
| View | view | text | empty | Name of the scroll view this bar drives. |
| Axis | axis | one of Vertical, Horizontal | Vertical | Which way the bar runs. |
| Min Thumb | min_thumb | number, at least 1 | 24 | Shortest the thumb may get, in UI units. |
| Thumb | thumb | colour | #ffffff, 60% opaque | Colour of the thumb that shows where the view is scrolled to. |
| Textures | ||||
| Thumb Texture | thumb_texture | asset | none | A picture for the thumb, or nothing for a flat colour. |
| Border | border | number, at least 0 | 0 | How much of each edge of the thumb's picture keeps its size while the middle stretches. |