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

Static variables

@:value(1)staticinlineread onlyHIGHLIGHT:Int = 1

Used with public variable status, means highlighted (usually from mouse over).

@:value(0)staticinlineread onlyNORMAL:Int = 0

Used with public variable status, means not highlighted or pressed.

@:value(2)staticinlineread onlyPRESSED:Int = 2

Used with public variable status, means pressed (usually from mouse click).

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