gamepad_button_value

Returns the current position of an analogue button.

Syntax:

gamepad_button_value(device, button);


Argument Description
device Which gamepad device "slot" to check.
button Which gamepad button constant to check for.


Returns: Real


Description

With this function you can get the current value of an analogue button, from 0 to 1, where 0 is no pressure and 1 is full pressure.


Example:

speed = gamepad_button_value(0, gp_shoulderrb) * 4;

The above code uses the analogue trigger value from the gamepad plugged into device "slot" 0 to set the speed of the instance.


Back: GamePad Input
Next: gamepad_set_vibration
© Copyright YoYo Games Ltd. 2017 All Rights Reserved