LittleJS 1.30.1

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:1408

Create a UITextInput object

pos Vector2 optional
size Vector2 optional
text string optional

Members

Methods

Inherited from UIObject

Members

maxLength : numberuiSystem.js:1422

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

text : stringuiSystem.js:1426

The text typed in it

Methods

click(playSound)uiSystem.js:1433

Start editing the text, called when it is clicked

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

Key down event handler if this object is being edited

e KeyboardEvent
stopEditing()uiSystem.js:1448

Stop editing the text