class flixel.input.gamepad.FlxGamepadManager implements IFlxInput

Available on all platforms

Manages gamepad input * @author Zaphod

Instance Fields

var firstActive:FlxGamepad

The first accessed gamepad - can be null!

var globalDeadZone:Float

While you can have each joystick use a custom dead zone, setting this will * set every gamepad to use this deadzone.

var lastActive:FlxGamepad

The last accessed gamepad - can be null!

var numActiveGamepads:Int

A counter for the number of active gamepads

function anyButton():Bool

Check to see if any button was pressed on any Gamepad

function anyInput():Bool

Check to see if any buttons are pressed right or Axis, Ball and Hat Moved on any Gamepad

function anyJustPressed(ButtonID:Int):Bool

Check to see if this button was just pressed on any Gamepad. * *

ButtonID

The button id (from 0 to 7). *

returns

Whether the button was just pressed

function anyJustReleased(ButtonID:Int):Bool

Check to see if this button is just released on any Gamepad. * *

ButtonID

The Button id (from 0 to 7). *

returns

Whether the button is just released.

function anyPressed(ButtonID:Int):Bool

Check to see if this button is pressed on any Gamepad. * *

ButtonID

The button id (from 0 to 7). *

returns

Whether the button is pressed

function destroy():Void

Clean up memory. Internal use only.

function getActiveGamepadIDs(?IDsArray:Array<Int> = null):Array<Int>

Get array of ids for gamepads with any pressed buttons or moved Axis, Ball and Hat. * *

IDsArray

optional array to fill with ids *

returns

array filled with active gamepad ids

function getActiveGamepads(?GamepadArray:Array<FlxGamepad> = null):Array<FlxGamepad>

Get array of gamepads with any pressed buttons or moved Axis, Ball and Hat. * *

GamepadArray

optional array to fill with active gamepads *

returns

array filled with active gamepads

function getByID(GamepadID:Int):FlxGamepad

function getFirstActiveGamepad():FlxGamepad

Get first found active gamepad (with any pressed buttons or moved Axis, Ball and Hat). * Returns null if no active gamepad has been found.

function getFirstActiveGamepadID():Int

Get first found active gamepad id (with any pressed buttons or moved Axis, Ball and Hat). * Returns "-1" if no active gamepad has been found.

function reset():Void

Resets all the keys on all joys.