Textbox Class
A window element used to enter text
Method Index
- abort()
- allowedInput(types)
- characterLimit(limit)
- clicked()
- confirm()
- drawCursor(canvas, x, y)
- input(char, rawchar, code)
- onTick()
- setActive(active)
- setPosition(x, y)
- setSize(width, height)
- setText(text)
Member Index
- abort_callback
- active
- allowed_input
- button
- char_limit
- confirm_callback
- cursor_counter
- cursor_pos
- cursor_state
- enabled
- panel
- text
- visible
function Textbox:Textbox()
Declared on: line 839 of Lua/window.lua.
function Textbox:abort()
Set the box to not active and run abort callback, if any
Declared on: line 892 of Lua/window.lua.
function Textbox:allowedInput(types)
"misc": other characters, currently space and hyphen
"all": experimental category that allows, theoretically, all input
Parameters:
Name | Type | Description |
---|---|---|
types | string or or or table | One of, or an table of any number of input types |
Declared on: line 1133 of Lua/window.lua.
function Textbox:characterLimit(limit)
Limit input to a maximum of [limit] characters.
Parameters:
Name | Type | Description |
---|---|---|
limit | integer or or or nil | Number of characters until the textbox will stop accepting input, or nil to deactivate limit. |
Declared on: line 1150 of Lua/window.lua.
function Textbox:clicked()
Declared on: line 934 of Lua/window.lua.
function Textbox:confirm()
Set the box to not active and run confirm callback, if any
Declared on: line 884 of Lua/window.lua.
function Textbox:drawCursor(canvas, x, y)
Parameters:
Name | Type | Description |
---|---|---|
canvas | ? | ? |
x | ? | ? |
y | ? | ? |
Declared on: line 870 of Lua/window.lua.
function Textbox:input(char, rawchar, code)
Parameters:
Name | Type | Description |
---|---|---|
char | ? | ? |
rawchar | ? | ? |
code | ? | ? |
Declared on: line 947 of Lua/window.lua.
function Textbox:onTick()
Declared on: line 858 of Lua/window.lua.
function Textbox:setActive(active)
Set the textbox active status to true or false, taking care of any
additional things that need to be done: deactivate any other textboxes,
handle blinking cursor, keyboard repeat on/off, set button state accordingly
Parameters:
Name | Type | Description |
---|---|---|
active | boolean | whether to activate (true) or deactivate (false) the box |
Declared on: line 900 of Lua/window.lua.
function Textbox:setPosition(x, y)
Parameters:
Name | Type | Description |
---|---|---|
x | ? | ? |
y | ? | ? |
Declared on: line 1169 of Lua/window.lua.
function Textbox:setSize(width, height)
Parameters:
Name | Type | Description |
---|---|---|
width | ? | ? |
height | ? | ? |
Declared on: line 1173 of Lua/window.lua.
function Textbox:setText(text)
Use empty string to make textbox a single line textbox (default).
Use table with empty string {""} to make it a multiline textbox.
Parameters:
Name | Type | Description |
---|---|---|
text | string or or or table | The string or list of strings the textbox should contain. |
Declared on: line 1158 of Lua/window.lua.