class flixel.addons.ui.FlxClickArea extends FlxObject

Available on all platforms

Trimmed-down button, invisible click area, only responds to onUP

Instance Fields

var status:Int

Shows the current state of the button, either NORMAL, * HIGHLIGHT or PRESSED

function new(?X:Float = 0, ?Y:Float = 0, ?Width:Float = 80, ?Height:Float = 20, ?OnUp:Void ->Void = null):Void

Creates a new FlxClickArea object * and a callback function on the UI thread. * *

X

The X position of the button. *

Y

The Y position of the button. *

Width

Width of the area *

Height

Height of the area *

OnUp

The function to call whenever the button is clicked.

function destroy():Void

Called by the game state when state is changed (if this object belongs to the state)

function onUp():Void

This function is called when the button is released. * We recommend assigning your main button behavior to this function * via the FlxClickArea constructor.

function update():Void

Called by the game loop automatically, handles mouseover and click detection.