Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

CheckButton

Globals

UI_BUTTON_DISABLED

integer

UI_BUTTON_HIGHLIGHTED

integer

UI_BUTTON_MAX

integer

UI_BUTTON_NORMAL

integer

UI_BUTTON_PUSHED

integer

Classes

Class: CheckButton

Extends Button

CheckButton

A CheckButton widget is a small clickable widget that represents a binary on/off or true/false setting or option. It inherits from Button and supports the same four visual states: normal, highlighted (hover), pushed (pressed), and disabled. Adds checked/unchecked state management with separate background drawables for checked and disabled-checked states. Can trigger the widget "OnCheckChanged" action.

Dependencies:

Method: GetChecked

(method) CheckButton:GetChecked()
  -> checked: boolean

Returns a boolean indicating the state of the CheckButton.

@return checkedtrue if the CheckButton is checked, false otherwise. (default: false)

Method: SetCheckedBackground

(method) CheckButton:SetCheckedBackground(checkedTable: DrawableDDS)

Sets the background for the checked state of the CheckButton.

@param checkedTable — The table defining the checked state background.

See: DrawableDDS

Method: SetChecked

(method) CheckButton:SetChecked(state: boolean, trigger: boolean|nil)

Sets the state of the CheckButton.

@param statetrue to check the CheckButton, false to uncheck. (default: false)

@param triggertrue to trigger the "OnCheckChanged" action, false to do nothing. (default: false)

Method: SetDisabledCheckedBackground

(method) CheckButton:SetDisabledCheckedBackground(disabledCheckedTable: DrawableDDS)

Sets the background for the disabled checked state of the CheckButton.

@param disabledCheckedTable — The table defining the disabled checked state background.

See: DrawableDDS