form.addSensorField¶
since 1.5.4
Add a sensor 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 |
getValue |
function | yes | the function which will return the current value |
setValue |
function | yes | the function which will be called on value change |
filterValue |
function | optional | the function which will filter values |
Returns¶
The new field
Examples¶
From the official Ethos documentation
form.addSensorField(line, nil, function() return switch end, function(newValue) switch = newValue end)