Skip to main content

Scrollbar

Example

var scrollbar = new UiScrollbar(0, 0, 20, 200);
with (scrollbar.state) {
thumb_size = 30;
on_change = function() {
show_debug_message("Changed scrollbar position!");
};
}

State reference

VariableDescriptionTypeDefault
typeScrollbar variantRealui_enum_variants.primary
statusCurrent status of the scrollbarRealui_enum_scrollbar_status.idle
directionScrollbar directionRealui_enum_scrollbar_direction.vertical
valueCurrent normalized (0-1) scroll positionReal0
thumb_sizeScroll speedReal0

Events

on_change(component, scroll_value)

Called when the component is being scrolled. scroll_value indicates the current normalized (0-1) scroll position.

Enums

EnumValues
ui_enum_scrollbar_statusidle/hover/dragging
ui_enum_scrollbar_directionvertical/horizontal