textInput(hasFocus?: boolean, maxInputLength?: number): TextInputComp

Get input from the user and store it in the nodes text property, displaying it with the text component and allowing other functions to access it.

paramhasFocus- Whether the text input should have focus.

parammaxInputLength- The maximum length of the input.

const obj = add([
    text(""),
    textInput(),
])

obj.hasFocus = false
debug.log(obj.text) // oh no i cant see my new text since it was disabled

returnsThe text input comp.

sincev3001.0

kaplay logo

Misc

Layer