EditBox (inherits from Frame and FontInstance) is an interactive text field for keyboard input.

A user can input text into the edit box which can then be retrieved using the EditBox:GetText() function.

When declaring an edit box object make sure that you either set "font" attribute for <EditBox> element, or include a <FontString> element, thus declaring which font is to be used to display text input into your edit box. If you do not do so EditBox will not display any text, just a blinking cursor.

<EditBox name="TestEditBox">
      .. Size
      .. Anchors
      .. Layers
      .. etc.
      <FontString inherits="GameFontNormal"/>

Defined Methods

Defined Script Handlers

  • OnArrowPressed(self, key)
  • OnCharComposition(self, text) - Run when changing the input composition mode.
  • OnCursorChanged(self, x, y, w, h) - Run when moving the text insertion cursor.
  • OnEditFocusGained(self) - Run when gaining edit focus.
  • OnEditFocusLost(self) - Run when losing edit focus.
  • OnEnterPressed(self) - Run when pressing Enter while the widget has focus.
  • OnEscapePressed(self) - Run when pressing Escape while the widget has focus.
  • OnSpacePressed(self) - Run when pressing Space while the widget has focus.
  • OnInputLanguageChanged(self, language) - Run when changing the language input mode.
  • OnTabPressed(self) - Run when pressing Tab while the widget has focus.
  • OnTextChanged(self, userInput) - Run when changing the value.
  • OnTextSet(self) - Run when setting the value programmatically

See also