Class CheckBox

A check box.

Usage:

     -- Create a checkbox that prints when it is checked
     local checkbox = CheckBox(0, 0, 16)
     checkbox:addListener("selected", function(t, k, old, new)
       print("The checkbox was " .. (new and "checked" or "unchecked"))
     end

Fields

CheckBox.backgroundColor The color of the checkbox.
CheckBox.borderColor The color of the border of this checkbox.
CheckBox.checkColor The color of the check.
CheckBox.hoverColor The color of this checkbox when the mouse is over it.
CheckBox.pressedColor The color of this checkbox when it is pressed.

Constructor

CheckBox:_init (x, y, size) Constructs a new CheckBox.

Methods

CheckBox:drawCheck (dt) Draw the checkbox


Fields

CheckBox.backgroundColor
The color of the checkbox.
CheckBox.borderColor
The color of the border of this checkbox.
CheckBox.checkColor
The color of the check.
CheckBox.hoverColor
The color of this checkbox when the mouse is over it.
CheckBox.pressedColor
The color of this checkbox when it is pressed.

Constructor

CheckBox:_init (x, y, size)
Constructs a new CheckBox.

Parameters:

  • x The x coordinate of the new component, relative to its parent.
  • y The y coordinate of the new component, relative to its parent.
  • size The width and height of the new component.

Methods

CheckBox:drawCheck (dt)
Draw the checkbox

Parameters:

  • dt The time elapsed since the last draw.
generated by LDoc 1.4.3 Last updated 2015-02-10 07:20:59