Clone wiki

FlowGUI / Textbox

Description

A textbox is used to get input from the keyboard. By clicking on the textbox, the textbox gains focus and looks for input. Pressing the Right Mouse Button, Escape or Enter makes the textbox lose its focus. When you want to make a textbox you need to include the textbox script like this at the top of your menu script: import "Scripts/FlowGUI/FG_Textbox.lua"

Function

  • FG_Textbox:Create() --Creates a new textbox.
  • SetText() --Set the textbox's text.
  • GetText() --Returns the text of the textbox.
  • SetTextWrapping(value) --False by default. When set to true, the text is cut off by the width and offset of the textbox. When set to false, the width of the textbox automatically expands.
  • SetMaximumLength(length) --Sets the maximum length of the textbox.
  • GetMaximumLength() --Returns the maximum length of the textbox.
  • SetDebug(bool false) --False by default. When set to true, a gray rectangle is draw where the label should be.
  • SetMouseHoverEvent(function event) --Stores the function that needs to be executed when the mouse hovers the rectangle of the GUI element.
  • SetMouseDownEvent(function event) --Stores the function that needs to be executed when the mouse hovers and the left mouse button is held down on the rectangle of the GUI element.
  • SetMouseHitEvent(function event) --Stores the function that needs to be executed when the mouse hovers and the left mouse button is hit once on the rectangle of the GUI element.
  • SetTextChangeEvent (function event) -- Stores the function that needs to be executed when the text of the textbox has changed.
  • SetOnFocusGained(function event) -- Stores the function that needs to be executed when the textbox gains focus by pressing the left mouse button on it.
  • SetOnFocusLost (function event) -- Stores the function that needs to be executed when the focus of the textbox has been lost. Pressing the Right Mouse Button, Escape or Enter makes the textbox lose its focus.

Updated