Scrollbar
A basic scrollbar visual component that provides visual feedback for scrollable content.
The Scrollbar displays as a rectangular indicator that changes appearance based on user interaction (hover, press states). It consists of an inner quad with configurable insets and responds to pointer events for interactive feedback.
Usage example:
var scrollbar = new Scrollbar();
scrollbar.size(12, 100);
scrollbar.inset(1, 1, 1, 1); // top, right, bottom, left
add(scrollbar);
Instance Members
Default is false
, automatically set to true
when any of this instance's observable variables has changed.
Custom theme override for this scrollbar. If null, uses the global context theme
Set the insets for the inner quad on all sides.
Name | Type | Description |
---|---|---|
insetTop |
Float | Top inset in pixels |
insetRight |
Float | Right inset in pixels |
insetBottom |
Float | Bottom inset in pixels |
insetLeft |
Float | Left inset in pixels |
Creates a new Scrollbar instance.
Sets up the inner quad with default insets, configures pointer event handlers for hover and press states, and initializes with a default size of 12x12 pixels.
Private Members
Whether the mouse pointer is currently hovering over the scrollbar
Whether the scrollbar is currently being pressed/clicked
Left inset for the inner quad relative to the scrollbar bounds
Right inset for the inner quad relative to the scrollbar bounds
Top inset for the inner quad relative to the scrollbar bounds
Bottom inset for the inner quad relative to the scrollbar bounds
The inner quad that provides the visual appearance of the scrollbar
Event when any observable value as changed on this instance.
Name | Type |
---|---|
instance |
Scrollbar |
fromSerializedField |
Bool |
Event when theme field changes.
Name | Type |
---|---|
current |
Theme |
previous |
Theme |
Event when hover field changes.
Name | Type |
---|---|
current |
Bool |
previous |
Bool |
Event when pressed field changes.
Name | Type |
---|---|
current |
Bool |
previous |
Bool |
Updates the visual style of the scrollbar based on current state.
Colors the inner quad differently based on pressed/hover states:
- Pressed: Darker color (50% interpolation between background and text)
- Hover: Medium color (25% interpolation)
- Normal: Light background color
Metadata
Name | Parameters |
---|---|
:build |
tracker.macros.ObservableMacro.build() |
:autoBuild |
tracker.macros.ObservableMacro.build() |
:build |
tracker.macros.EventsMacro.build() |
:autoBuild |
tracker.macros.EventsMacro.build() |
:build |
ceramic.macros.EntityMacro.buildForCompletion() |
:autoBuild |
ceramic.macros.EntityMacro.buildForCompletion() |