Link Search Menu Expand Document

TextField

A text field, used for inputting text.

Set onReturn to define a function that gets called when the enter key is pressed (while the text field is focused):

 my_textfield.onReturn = function()
 -- do stuff
end

Set onChange to define a function that gets called when the contents of the text field have changed:

 my_textfield.onChange = function()
 -- do stuff
end

Set onLostFocus to define a function that gets called when the text field loses focus:

 my_textfield.onLostFocus = function()
 -- do stuff
end

Constructor

 local textfield = TextField(o)

For convenience, you may also set some or all of the TextField’s properties within the constructor, i.e.:

 local textfield = TextField{bounds=Bounds(0, 0, 0, 1.0, 0.1, 0.001), color={1.0,0.2,0.4,1}, halign="center"}

Arguments

Name Type Description
o table A table including at least a Bounds component.

Returns

Nothing


Methods

textfield:appendText (text)

Appends the provided text to the TextField

Arguments

Name Type Description
text string The text to append

Returns

Nothing