import{_ as s,o as a,c as e,Q as n}from"./chunks/framework.4313453f.js";const u=JSON.parse('{"title":"Slider","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"references/slider.md","filePath":"references/slider.md","lastUpdated":null}'),l={name:"references/slider.md"},o=n(`
Sliders are objects that allow users to scroll vertically or horizontally, which in turn changes a value that you can access using the :getValue() method.
| Property | Type | Description |
|---|---|---|
| knobSymbol | char | The character used to represent the knob on the slider. |
| knobBackground | color | Background color of the knob. |
| knobForeground | color | Foreground color of the knob. |
| bgSymbol | color | The character used to represent the slider's background track. |
| value | number | The current value the slider is set to. |
| minValue | number | The minimum value the slider can be set to. |
| maxValue | number | The maximum value the slider can be set to. |
| step | number | The incremental value by which the slider adjusts its value. For instance, a step of 10 on a 0-100 scale would allow values of 0, 10, 20, ... and so on. |
Here's a demonstration of how to create and utilize a Slider object within the Basalt framework:
local main = basalt.createFrame()
local aSlider = main:addSlider()
-- Set properties for the slider
aSlider:setMinValue(0)
aSlider:setMaxValue(100)
aSlider:setStep(5) -- Increments of 5
-- Add an event listener to the slider to fetch the value when changed
aSlider:onChange(function()
local selectedValue = aSlider:getValue()
basalt.debug("The current value of the slider is: " .. selectedValue)
end)local main = basalt.createFrame()
local aSlider = main:addSlider()
-- Set properties for the slider
aSlider:setMinValue(0)
aSlider:setMaxValue(100)
aSlider:setStep(5) -- Increments of 5
-- Add an event listener to the slider to fetch the value when changed
aSlider:onChange(function()
local selectedValue = aSlider:getValue()
basalt.debug("The current value of the slider is: " .. selectedValue)
end)n this example, when a user moves the slider, its value changes in increments of 5, and the selected value is printed out.
`,8),t=[o];function p(r,c,d,i,y,E){return a(),e("div",null,t)}const F=s(l,[["render",p]]);export{u as __pageData,F as default};