class flixel.addons.ui.FlxUITypedButton<T> extends FlxTypedButton<T> implements ICursorPointable implements IHasParams implements IFlxUIClickable implements IFlxUIWidget implements IResizable

Available on all platforms

Class Fields

static var CLICK_EVENT:String

static var DOWN_EVENT:String

static var OUT_EVENT:String

static var OVER_EVENT:String

Instance Fields

var tile:Int

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

Creates a new FlxUITypedButton object with a gray background. * *

X

The X position of the button. *

Y

The Y position of the button. *

OnClick

The function to call whenever the button is clicked.

function assembleButtonFrames(upB:BitmapData, overB:BitmapData, downB:BitmapData):BitmapData

Give me three bitmapdatas and I'll return an assembled button bitmapdata for you. * If overB or downB are missing, it will not include those frames. * @return

upB*
overB*
downB*

function autoCenterLabel():Void

Sets labelOffset to center the label horizontally and vertically

function combineToggleBitmaps(normal:BitmapData, toggle:BitmapData):BitmapData

Combines two stacked button images for a toggle button * @return

normal*
toggle*

function destroy():Void

function forceStateHandler(event:String):Void

function grabButtonFrame(all_frames:BitmapData, button_state:Int, ?for_toggle:Bool = false, ?src_w:Int = 0, ?src_h:Int = 0):BitmapData

UTILITY FUNCTIONS

function loadGraphicSlice9(?assets:Array<String> = null, ?W:Int = 80, ?H:Int = 20, ?slice9:Array<Array<Int>> = null, ?Tile:Int = 0, ?Resize_Ratio:Float = -1, ?isToggle:Bool = false, ?src_w:Int = 0, ?src_h:Int = 0, ?frame_indeces:Array<Int> = null):Void

Graphics chopping functions

function loadGraphicsMultiple(assets:Array<String>, ?Key:String = ''):Void

Provide a list of assets, load states from each one *

assets*
key

string key for caching (optional)

function loadGraphicsUpOverDown(asset:Dynamic, ?for_toggle:Bool = false, ?key:String = null):Void

Provide one combined asset, load all 3 state frames from it and infer the width/height *

asset

graphic to load *

for_toggle

whether this is for a toggle button or not *

key

string key for caching (optional)

function resize(W:Float, H:Float):Void

function setAllLabelOffsets(X:Float, Y:Float):Void

Set all 3 sets of labelOffsets at once *

X*
Y

function update():Void

function updateButton():Void