form.addSliderField¶
since 1.5.2
Add a slider field to the current form.
Parameters¶
| Name | Type | Required | Description |
|---|---|---|---|
line |
FormLine | yes | the line where the field should be added |
rect |
Rect | yes | the coordinates |
min |
integer | yes | the min value |
max |
integer | yes | the max value |
getValue |
function | yes | the function which will return the current value |
setValue |
function | yes | the function which will be called on value change |
Returns¶
The new field
Examples¶
From the official Ethos documentation
form.addSliderField(line, nil, 0, 100, function() return value end, function(newValue) value = newValue end)
Real-world usage¶
Called 6 times across 5 open-source Ethos Lua projects. A few short excerpts: