form.addChoiceField¶
since 1.1.0
Add a choice 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 |
values |
table | yes | table of all possible values |
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.addChoiceField(line, nil, values, function() return value end, function(newValue) value = newValue end)
Used in¶
Real-world usage¶
Called 188 times across 9 open-source Ethos Lua projects. A few short excerpts: