Skip to content

Helper class for managing controls inputs

Static Functions

determinePressedControls(previousControls:Int, currentControls:Int):Int

Description

Figures out which buttons were pressed VS held provided the previous and current control bits Parameters:

  • previousControls - Bits for the previous buttons
  • currentControls - Bits for the current buttons

Instance Variables

ACTION

Type

Bool

Initial Value

n/a

Description

ATTACK

Type

Bool

Initial Value

n/a

Description

CROUCH

Type

Bool

Initial Value

n/a

Description

DASH

Type

Bool

Initial Value

n/a

Description

DOWN

Type

Bool

Initial Value

n/a

Description

DROP_THROUGH

Type

Bool

Initial Value

n/a

Description

EMOTE

Type

Bool

Initial Value

n/a

Description

FULL_HOP

Type

Bool

Initial Value

n/a

Description

GRAB

Type

Bool

Initial Value

n/a

Description

JUMP

Type

Bool

Initial Value

n/a

Description

JUMP_ANY

Type

Bool

Initial Value

n/a

Description

LEFT

Type

Bool

Initial Value

n/a

Description

PAUSE

Type

Bool

Initial Value

n/a

Description
Type

Bool

Initial Value

n/a

Description

RIGHT_STICK_DOWN

Type

Bool

Initial Value

n/a

Description

RIGHT_STICK_LEFT

Type

Bool

Initial Value

n/a

Description

RIGHT_STICK_RIGHT

Type

Bool

Initial Value

n/a

Description

RIGHT_STICK_UP

Type

Bool

Initial Value

n/a

Description

SHIELD

Type

Bool

Initial Value

n/a

Description

SHIELD1

Type

Bool

Initial Value

n/a

Description

SHIELD2

Type

Bool

Initial Value

n/a

Description

SHIELD_AIR

Type

Bool

Initial Value

n/a

Description

SHORT_HOP

Type

Bool

Initial Value

n/a

Description

SPECIAL

Type

Bool

Initial Value

n/a

Description

STRONG

Type

Bool

Initial Value

n/a

Description

TAP_JUMP

Type

Bool

Initial Value

n/a

Description

TILT

Type

Bool

Initial Value

n/a

Description

UP

Type

Bool

Initial Value

n/a

Description

buttons

Type

Int

Initial Value

n/a

Description

Current state of button inputs represented by a 32-bit integer

flags

Type

Int

Initial Value

n/a

Description

Current state of input flags represented by a 32-bit integer

leftStickAngle

Type

Float

Initial Value

n/a

Description

Angle of the left stick calculated using leftStickX and leftStickY

leftStickAxes

Type

Int

Initial Value

n/a

Description

leftStickX

Type

Float

Initial Value

n/a

Description

leftStickY

Type

Float

Initial Value

n/a

Description

rightStickAngle

Type

Float

Initial Value

n/a

Description

Angle of the right stick calculated using leftStickX and leftStickY

rightStickAxes

Type

Int

Initial Value

n/a

Description

rightStickX

Type

Float

Initial Value

n/a

Description

rightStickY

Type

Float

Initial Value

n/a

Description

Instance Functions

analogDashActive():Bool

Description

analogWalkActive():Bool

Description

clone():ControlsObject

Description

copyFrom(controlsObject:ControlsObject):Void

Description

Copies the controls values from another ControlsObject instance Parameters:

  • controlsObject - The ControlsObject instance to copy controls data from

digitalDashActive():Bool

Description

digitalWalkActive():Bool

Description

getAngle(rightStick?:Bool):Float

Description

Returns the angle of the left stick or right sticks, rounded to the nearest 45 degree angle Parameters:

  • rightStick - Pass as true to use the right stick for the angle calculation. Otherwise the left stick is used.

hasRightStickAttackFlag():Bool

Description

hasRightStickSpecialFlag():Bool

Description

reset():Void

Description

rightStickPressed():Bool

Description

syncStickAngles():Void

Description

syncStickButtons():Void

Description

Ensure the directional buttons correspond with any stick angle

toString():String

Description

Returns a user readable string of current inputs