onGamepadButtonPress(btn: KGamepadButton | KGamepadButton[], action: (btn: KGamepadButton, gamepad: KGamepad)=>void): KEventController
Register an event that runs when user presses certain gamepad button.
param
btn- The button(s) to listen for. See
param
action- The function that is run when certain gamepad buttons are pressed.
// when user presses button onGamepadButtonPress("south", (btn, gp) => { player.jump(200); });
returns
The event controller.
since
v3001.0