Skip to content

form.addSwitch

since 1.6.3

Add a switch widget.

form.addSwitch(line, rect, index, type)

Parameters

Name Type Required Description
line FormLine yes the line where the widget should be added
rect Rect yes the coordinates
index number yes the switch index
type string yes switch type, can take the values "lever" (default) or "push"

Returns

Nothing.

Examples

From the official Ethos documentation
form.addSwitch(nil, {x=0, y=0}, 0, "push")