Skip to content

form.addTextButton

since 1.1.0 deprecated

Add a text button to the current form (deprecated)

form.addTextButton(line, rect, text, press)

Parameters

Name Type Required Description
line FormLine yes the line where the field should be added
rect Rect yes the coordinates
text string yes the displayed text
press function yes the function which will be called on button press

Returns

The new button

Examples

From the official Ethos documentation
form.addTextButton(line, nil, "Text Button", function() end)

Used in

Real-world usage

Called 80 times across 4 open-source Ethos Lua projects. A few short excerpts:
form.addTextButton(backLine, nil, "Back", backAction)

src/ethos-arcade/games/retrofight/game.lua:273

form.addTextButton(bestLine, nil, "Reset", resetBest)

src/ethos-flight-training/games/shared/trainer-core.lua:1090

form.addTextButton(backLine, nil, "Back to Game", backAction)

src/ethos-heli-training/games/collective-balance/game.lua:578