CorsixTH Lua Documentation

Button Class

A region of a `Panel` which causes some action when clicked.

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

Method Index

Member Index

function Button:enable(enable)

Parameters:

NameTypeDescription
enable ? ?

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

function Button:handleClick(mouse_button)

this or another button). However for repeat buttons, it is called once on MouseDown and, after

a short delay, repeatedly.

Parameters:

NameTypeDescription
mouse_button string either "left" or "right"

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

function Button:setDisabledSprite(index)

Parameters:

NameTypeDescription
index ? ?

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

function Button:setDynamicTooltip(callback, x, y)

Parameters:

NameTypeDescription
callback ? ?
x ? ?
y ? ?

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

function Button:setLabel(label, font, align)

Convenience function to allow setLabel to be called on a button, not only its panel.

see Panel:setLabel

Parameters:

NameTypeDescription
label ? ?
font ? ?
align ? ?

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

function Button:setPosition(x, y)

Parameters:

NameTypeDescription
x ? ?
y ? ?

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

function Button:setSize(width, height)

Parameters:

NameTypeDescription
width ? ?
height ? ?

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

function Button:setSound(name)

Parameters:

NameTypeDescription
name ? ?

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

function Button:setToggleState(state)

Parameters:

NameTypeDescription
state ? ?

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

function Button:setTooltip(tooltip, x, y)

Specify a tooltip to be displayed when hovering this button. x and y are optional position of bottom left of the tooltip. If not specified, will default to top center of button.

Parameters:

NameTypeDescription
tooltip ? ?
x ? ?
y ? ?

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

Page generated on Sat Feb 07, 2015 at 18:38:28 by LDocGen.