dot big bang

Developer API
Menu

Class Controls

All
  • Public
  • Public/Protected
  • All

Hierarchy

  • Controls

Index

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

getAction1HeldTime

  • getAction1HeldTime(): number
  • Returns how long the action has been held (0 if it's not held) in seconds.

    Returns number

getAction2HeldTime

  • getAction2HeldTime(): number
  • Returns how long the action has been held (0 if it's not held) in seconds.

    Returns number

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

isAction1JustPressed

  • isAction1JustPressed(): boolean
  • Indicates whether the action was just pressed this frame.

    Returns boolean

isAction1JustReleased

  • isAction1JustReleased(): boolean
  • Indicates whether the action was just released this frame.

    Returns boolean

isAction2JustPressed

  • isAction2JustPressed(): boolean
  • Indicates whether the action was just pressed this frame.

    Returns boolean

isAction2JustReleased

  • isAction2JustReleased(): boolean
  • Indicates whether the action was just released this frame.

    Returns boolean