class flixel.ui.FlxAnalog extends FlxSpriteGroup

Available on all platforms

A virtual thumbstick - useful for input on mobile devices. * * @author Ka Wing Chin

Instance Fields

var base:FlxSprite

The background of the joystick, also known as the base.

var justPressed:Bool

Whether the thumb is just pressed or not.

var justReleased:Bool

Whether the thumb is just released or not.

var pressed:Bool

Whether the thumb is pressed or not.

var status:Int

Shows the current state of the button.

function new(X:Float, Y:Float, ?Radius:Float = 0, ?Ease:Float = 0.25f):Void

Create a virtual thumbstick - useful for input on mobile devices. * *

X

The X-coordinate of the point in space. *

Y

The Y-coordinate of the point in space. *

radius

The radius where the thumb can move. If 0, the background will be use as radius. *

ease

The duration of the easing. The value must be between 0 and 1.

function destroy():Void

Clean up memory.

function getAngle():Float

Returns the angle in degrees. * *

returns

The angle.

function onDown():Void

This function is called when the button is pressed down.

function onOver():Void

This function is called when the mouse goes over the button.

function onPressed():Void

This function is called when the button is hold down.

function onUp():Void

This function is called when the button is released.

function update():Void

Update the behavior.