import{_ as t,a,b as r,ag as d}from"./chunks/framework.BcrMLAmg.js";const p=JSON.parse('{"title":"Slider","description":"","frontmatter":{},"headers":[],"relativePath":"references/elements/Slider.md","filePath":"references/elements/Slider.md","lastUpdated":1757844696000}'),i={name:"references/elements/Slider.md"};function s(l,e,o,h,n,u){return r(),a("div",null,e[0]||(e[0]=[d('
This is the slider class. It provides a draggable slider control that can be either horizontal or vertical,with customizable colors and value ranges.
Extends: VisualElement
| Property | Type | Default | Description |
|---|---|---|---|
| step | number | 1 | Current position of the slider handle (1 to width/height) |
| max | number | 100 | Maximum value for value conversion (maps slider position to this range) |
| horizontal | boolean | true | Whether the slider is horizontal (false for vertical) |
| barColor | color | gray | Color of the slider track |
| sliderColor | color | blue | Color of the slider handle |
| Event | Parameters | Description |
|---|---|---|
| onChange | value number | Fired when the slider value changes |
| Method | Returns | Description |
|---|---|---|
| Slider:getValue | number | Gets the current value mapped to the max range |
Gets the current value of the slider
number value The current value (0 to max)local value = slider:getValue()