dot big bang

Developer API
Menu

Class Controls

All
  • Public
  • Public/Protected
  • All

Hierarchy

  • Controls

Index

Accessors

Methods

Accessors

action1

  • get action1(): boolean
  • Indicates whether the primary button/action is pressed.

    Returns boolean

action2

  • get action2(): boolean
  • Indicates whether the secondary button/action is pressed.

    Returns boolean

Methods

getStick1

  • The state of the primary stick on the Controls virtual device. The primary stick is usually used to controls the movement of the player character. The x and y values of the Vector2 respectively represent the horizontal and vertical axes on the virtual device. -1.0 normally corresponds to "forward" or "left", and 1.0 normally corresponds to "backward" or "right". All values are linearly normalized to the range [-1.0 .. 1.0].

    Parameters

    • Optional optionalTarget: Vector2

      When not provided, the method creates an object to store the result and then returns it. Providing this argument avoids this object allocation.

    Returns Vector2

getStick2

  • The state of the secondary stick on the Controls virtual device. The secondary stick is typically used The secondary stick is usually used to controls the camera. The x and y values of the Vector2 respectively represent the horizontal and vertical axes on the virtual device. -1.0 normally corresponds to "forward" or "left", and 1.0 normally corresponds to "backward" or "right". All values are linearly normalized to the range [-1.0 .. 1.0].

    Parameters

    • Optional optionalTarget: Vector2

      When not provided, the method creates an object to store the result and then returns it. Providing this argument avoids this object allocation.

    Returns Vector2