Slider
March 4, 2015 ยท View on GitHub
Overview
Sliders can be used to show or get progress.
<slider text="position" progress="50" progressmax="100" onchange="update" />
actions.update = function (progress)
print("progress was changed to " .. progress);
end
Properties
id
Set the ID for this control so that it can be updated later. See layout library.
<slider id="my_slider" text="foo" />
visibility
Set the visibility state using visible or invisible or gone.
<slider visibility="gone" />
text
Set additional text to be shown in the slider.
<slider text="hello world" progress="50" progressmax="100" />
will show:
hello world - 50%
If you don't specify a text only the percentage will be shown:
50%
progress
Set the current progress value of the slider.
<slider progress="99" />
progressmax
Set the maximum progress value of the slider (default 100).
<slider progressmax="200" />
Styling
See the styling page for more details.
Events
onchange
Occurs when the slider progress is changing.
<slider onchange="changing" />
actions.changing = function (value)
...
end
ondone
Occurs when the slider has finished changing value.
<slider ondone="finish" />
actions.finish = function (value)
...
end
ondown
Occurs when the slider is pressed (i.e. starts sliding).
<slider ondown="start" />
actions.start = function (value)
...
end
onup
Occurs when the slider is released (i.e. stops sliding).
<slider onup="stop" />
actions.stop = function (value)
...
end