Skip to content
Benedict Allen edited this page Nov 15, 2015 · 2 revisions

Checkbox Class

The Checkbox is a 1x1 clickable object that toggles a check ("x") in its centre.

Extends Sheet

Style options

  • colour - The background colour.
  • colour.checked - The background colour when checked.
  • colour.pressed - The background colour when pressed.
  • textColour - The text colour.
  • textColour.pressed - The text colour when pressed.

Constructor

Checkbox( number x, number y, boolean checked = false )

Callbacks

Note, this element uses the onPreDraw() and onMouseEvent() callbacks of Sheet.

onToggle()

Checkbox:onToggle( number button, number x, number y )

Called when the checkbox is toggled.

onCheck()

Checkbox:onCheck()

Called when the button is checked (in addition to onToggle()).

onUnCheck()

Checkbox:onUnCheck()

Called when the button is unchecked (in addition to onToggle()).

Variables

checked

Checkbox.checked - boolean

Whether the checkbox is checked.

Methods

toggle()

Checkbox:toggle()

Toggles the state of the checkbox.

Clone this wiki locally