class flixel.ui.FlxTypedButton<T> extends FlxSprite
Available on all platforms
Sub classes | ||||||||
![]() | FlxUITypedButton, FlxButton, PxButton |
|
A simple button class that calls a function when clicked by the mouse.
Instance Fields
var allowHighlightOnMobile:Bool
Whether to allow the HIHGLIGHT frame of the button graphic to be used on mobile * (false by default, the NORMAL graphic is used instead then).
var allowSwiping:Bool
Whether you can press the button simply by releasing the touch / mouse button over it (default). * If false, the input has to be pressed while hovering over the button.
var labelAlphas:Array<Float>
What alpha value the label should have for each status. Default is [0.8, 1.0, 0.5].
Shows the current state of the button, either FlxButton.NORMAL, * FlxButton.HIGHLIGHT or FlxButton.PRESSED.
function new(?X:Float = 0, ?Y:Float = 0, ?OnClick:Void ->Void = null):Void
Creates a new FlxTypedButton 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. |