A simple button class that calls a function when clicked by the mouse.

Constructor

@:value({ Y : 0, X : 0 })new(X:Float = 0, Y:Float = 0, ?Text:String, ?OnClick:() ‑> Void)

Creates a new FlxButton object with a gray background and a callback function on the UI thread.

Parameters:

X

The x position of the button.

Y

The y position of the button.

Text

The text that you want to appear on the button.

OnClick

The function to call whenever the button is clicked.

Variables

text:String

Shortcut to setting label.text