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

Button Class

The Button is a clickable object with word wrapped text (default centre aligned).

Extends Sheet

Style options

  • colour - The background colour.
  • colour.pressed - The background colour when pressed.
  • textColour - The text colour.
  • textColour.pressed - The text colour when pressed.
  • horizontal-alignment - The horizontal alignment.
  • horizontal-alignment.pressed - The horizontal alignment when pressed.
  • vertical-alignment - The vertical alignment.
  • vertical-alignment.pressed - The vertical alignment when pressed.

Constructor

Button( number x, number y, number width, number height, string text )

Implements

Callbacks

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

onClick()

Button:onClick( number button, number x, number y )

Called when the button is clicked.

onHold()

onHold( number button, number x, number y )

Called when the button is held.

Clone this wiki locally