Phaser API Documentation

  Version: 
getButtonValue(index)

Description:

Gets the value of a button based on the given index. The index must be valid within the range of buttons supported by this Gamepad.

The return value will be either 0 or 1 for an analogue button, or a float between 0 and 1 for a pressure-sensitive digital button, such as the shoulder buttons on a Dual Shock.

Parameters:

name type description
index number

The index of the button to get the value for.

Returns:
Description:

The value of the button, between 0 and 1.

Type:
  • number
Examples:
Since: 3.10.0