Class Button

A clickable button.

Usage:

     -- Create an empty button that prints when it is clicked
     local button = Button(0, 0, 100, 100)
     button.onClick = function(component, button)
       print("Clicked with mouse button " .. button)
     end

Fields

Button.color The color of this button.
Button.hoverColor The color of this button when the mouse is over it.
Button.innerBorderColor The color of the inner border of this button.
Button.innerBorderHoverColor The color of the inner border of this button when the mouse is over it.
Button.outerBorderColor The color of the outer border of this button.

Constructor

Button:_init (x, y, width, height) Constructs a new Button.

Methods

Button:onClick (button) Called when this button is clicked.


Fields

Button.color
The color of this button.
Button.hoverColor
The color of this button when the mouse is over it.
Button.innerBorderColor
The color of the inner border of this button.
Button.innerBorderHoverColor
The color of the inner border of this button when the mouse is over it.
Button.outerBorderColor
The color of the outer border of this button.

Constructor

Button:_init (x, y, width, height)
Constructs a new Button.

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.
  • width The width of the new component.
  • height The height of the new component.

Methods

Button:onClick (button)
Called when this button is clicked.

Parameters:

  • button The mouse button that was used.
generated by LDoc 1.4.3 Last updated 2015-02-10 07:20:59