TextInput

Extends: UiWidget

A focusable single-line text entry widget. Characters arrive via onECPKeyboard() (Roku's mobile-app on-screen keyboard sends individual characters this way - see Game.bs's existing onECPKeyboard dispatch, which already reaches every UiContainer child unconditionally, same as onInput()). Left/Right (while focused) move the caret; OK fires onSubmit. No on-screen virtual keyboard is drawn by this widget - it relies entirely on the platform's own text-entry mechanism delivering onECPKeyboard() characters.

Properties

  • text (string) — Current text content.
  • cursorIndex (integer) — Caret position, 0..Len(text). Moved by Left/Right while focused, and
  • maxLength (integer) — Maximum text length, 0 = unlimited. A character typed once text.Len()
  • placeholder (string) — Text shown (dimmed) when text is empty and this widget isn't focused.
  • onChanged (function | dynamic) — Called after any edit (insert/delete) - function(input as TextInput) as void
  • onSubmit (function | dynamic) — Called on OK-press while focused - function(input as TextInput) as void
  • lastChangedValue (dynamic) — Test accessor: last value an onChanged callback stashed here. Not part
  • drawableText (BGE.DrawableText)
  • repeatThrottle (BGE.UI.RepeatThrottle) — Throttles repeat-while-held Left/Right to one step per

Constructor

new TextInput(game: BGE.Game): TextInput

Parameters


Instance Methods

getValue(): dynamic

Returns

  • dynamic

onECPKeyboard(char: integer): void

Parameters

  • char (integer)

Returns

  • void

handleInput(input: BGE.GameInput): boolean

Parameters

Returns

  • boolean

onClick(): void

Returns

  • void

draw(parent?: UiWidget): void

Parameters

  • parent (UiWidget, optional, default: "invalid")

Returns

  • void