class flixel.ui.FlxButton extends FlxTypedButton<FlxText>

Available on all platforms

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

Class Fields

static var HIGHLIGHT:Int

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

static var NORMAL:Int

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

static var PRESSED:Int

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

Instance Fields

var text:String

Shortcut to setting label.text

function new(?X:Float = 0, ?Y:Float = 0, ?Text:String = null, ?OnClick:Void ->Void = null):Void

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

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.