CorsixTH Lua Documentation

Textbox Class

A window element used to enter text

Declared on: line 943 of Lua/window.lua.

Method Index

Member Index

function Textbox:abort()

Set the box to not active and run abort callback, if any

Declared on: line 1006 of Lua/window.lua.

function Textbox:allowedInput(types)

"misc": other characters, currently space and hyphen

"all": experimental category that allows, theoretically, all input

Parameters:

NameTypeDescription
types string or or or table One of, or an table of any number of input types

Declared on: line 1262 of Lua/window.lua.

function Textbox:characterLimit(limit)

Limit input to a maximum of [limit] characters.

Parameters:

NameTypeDescription
limit integer or or or nil Number of characters until the textbox will stop accepting input, or nil to deactivate limit.

Declared on: line 1279 of Lua/window.lua.

function Textbox:confirm()

Set the box to not active and run confirm callback, if any

Declared on: line 998 of Lua/window.lua.

function Textbox:drawCursor(canvas, x, y)

Parameters:

NameTypeDescription
canvas ? ?
x ? ?
y ? ?

Declared on: line 980 of Lua/window.lua.

function Textbox:keyInput(char, rawchar)

Handles special characters such as Enter. Normal text input is processed in the textInput function.

Note though that this function still returns true if it appears to be a characters being entered.

Parameters:

NameTypeDescription
char ? ?
rawchar ? ?

Declared on: line 1059 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:

NameTypeDescription
active boolean whether to activate (true) or deactivate (false) the box

Declared on: line 1014 of Lua/window.lua.

function Textbox:setPosition(x, y)

Parameters:

NameTypeDescription
x ? ?
y ? ?

Declared on: line 1298 of Lua/window.lua.

function Textbox:setSize(width, height)

Parameters:

NameTypeDescription
width ? ?
height ? ?

Declared on: line 1302 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:

NameTypeDescription
text string or or or table The string or list of strings the textbox should contain.

Declared on: line 1287 of Lua/window.lua.

function Textbox:textInput(text)

Handles actual text input.

Parameters:

NameTypeDescription
text ? ?

Declared on: line 1242 of Lua/window.lua.