Skip to content

Latest commit

 

History

History
41 lines (29 loc) · 1.6 KB

File metadata and controls

41 lines (29 loc) · 1.6 KB

TextInput

A text input that can be rendered on screen.


Constructor

new TextInput(scene, config);

Arguments

  • sceneScene The scene this Object is a part of.
  • configObject The TextInput's config object.
    • xnumber This TextInput object's x-coordinate.
    • ynumber This TextInput object's y-coordinate.
    • maxWidthnumber The maximum width of the TextInput.
    • valuestring The text to display. (use "\n" for newlines)
    • colorstring Optional text color.
    • activeColorstring Optional text color for active character.
    • backgroundColorstring Optional background color.
    • backgroundColorActivestring Optional background color for active key.
    • fontWeightstring Optional font weight.
    • autoFocusboolean Automatically focus on element once it is instantiated.
    • onChangefunction Callback that runs when the input's value changes.
    • onKeyDownfunction Callback that runs when the input receives a keypress.
    • onFocusfunction Callback that runs when focus on this input is gained.
    • onBlurfunction Callback that runs when focus on this input is lost.
    • maxLengthnumber An optional maximum input length.

Properties

caret

The current position of the caret.

renderable

The renderable PixelMesh representation of the TextInput, including text color, background color, and caret behavior.