Slider
Description
The slider
command creates an interactive slider control that allows users to select a value by dragging a handle along a track. The slider is positioned relative to the current draw cursor position and automatically maintains its own state.
Syntax
Parameters
width
: Width of the slider track in pixelsheight
: Height of the slider track in pixelsid
: Unique identifier for the slider, used to access its value
Usage Examples
Important Notes
The slider value is automatically stored in a variable matching the provided
id
Slider values range from 0 to 1 (0% to 100%)
The slider handle position reflects the current value
Sliders are interactive and respond to both mouse and touch input
Multiple sliders can be used simultaneously with different IDs
The slider position is relative to the current draw cursor
Slider state persists between frames unless explicitly changed
The ID must be unique to avoid conflicts with other UI elements
Last updated
Was this helpful?