Skip to main content

Scrollable Container

This is a basic component to handle a container with a scrollable area and the related scrollbar. Children components will be able to be scrolled trough the area.

Example

var scrollable_container = new UiScrollableContainer(0, 0, 200, 200);
with (scrollable_container.state) {
scrollable_width = 400;
scrollable_height = 800;
on_change = function() {
show_debug_message("Changed scroll position!");
};
}

State reference

VariableDescriptionTypeDefault
scrollable_widthScrollable area widthRealEquals to the component width
scrollable_heightScrollable area heightRealEquals to the component height
scroll_stepScroll speedReal24

Events

on_change(component, scroll_direction, scroll_value)

Called when the container is being scrolled. scroll_direction param indicates the scroll direction and scroll_value the scrolling difference.

Enums

EnumValues
ui_enum_scroll_directionvertical/horizontal