Button Class
A region of a `Panel` which causes some action when clicked.
Declared on: line 384 of Lua/window.lua.
Method Index
- enable(enable)
- makeToggle()
- preservePanel()
- setDisabledSprite(index)
- setDynamicTooltip(callback, x, y)
- setSound(name)
- setToggleState(state)
- setTooltip(tooltip, x, y)
- toggle()
Member Index
- b
- enabled
- is_toggle
- on_click
- on_click_self
- on_rightclick
- panel_for_sprite
- panel_lowered_active
- panel_lowered_normal
- r
- sound
- sprite_index_active
- sprite_index_disabled
- sprite_index_normal
- toggled
- tooltip
- x
- y
function Button:Button()
Declared on: line 387 of Lua/window.lua.
function Button:enable(enable)
Parameters:
Name | Type | Description |
---|---|---|
enable | ? | ? |
Declared on: line 413 of Lua/window.lua.
function Button:makeToggle()
Declared on: line 431 of Lua/window.lua.
function Button:preservePanel()
Declared on: line 455 of Lua/window.lua.
function Button:setDisabledSprite(index)
Parameters:
Name | Type | Description |
---|---|---|
index | ? | ? |
Declared on: line 408 of Lua/window.lua.
function Button:setDynamicTooltip(callback, x, y)
Parameters:
Name | Type | Description |
---|---|---|
callback | ? | ? |
x | ? | ? |
y | ? | ? |
Declared on: line 483 of Lua/window.lua.
function Button:setSound(name)
Parameters:
Name | Type | Description |
---|---|---|
name | ? | ? |
Declared on: line 462 of Lua/window.lua.
function Button:setToggleState(state)
Parameters:
Name | Type | Description |
---|---|---|
state | ? | ? |
Declared on: line 448 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:
Name | Type | Description |
---|---|---|
tooltip | ? | ? |
x | ? | ? |
y | ? | ? |
Declared on: line 471 of Lua/window.lua.
function Button:toggle()
Declared on: line 437 of Lua/window.lua.