LittleJS 1.28.0

UISystem

UITextInput

UITextInput - An editable text input field

  • A simple text entry field that supports basic editing
  • Suitable for short text input like names or numbers
  • Reads a physical keyboard: no on-screen keyboard opens on touch devices, and IME composition and paste do not type, use an HTML input element for those

Extends UIObject

Constructor

new UITextInput(pos, size, text)uiSystem.js:1396

Create a UITextInput object

pos Vector2 optional
size Vector2 optional
text string optional

Members

Methods

Inherited from UIObject

Members

maxLength : numberuiSystem.js:1410

Max length of input in characters as a reader counts them (0 = no limit)

text : stringuiSystem.js:1414

The text typed in it

Methods

click(playSound)uiSystem.js:1421

Start editing the text, called when it is clicked

playSound boolean optional, default true
onKeyDown(e)uiSystem.js:1450

Key down event handler if this object is being edited

e KeyboardEvent
stopEditing()uiSystem.js:1436

Stop editing the text