Kosmoon Posted August 27, 2018 Share Posted August 27, 2018 Triggering fullscreen with onDownCallback with game.input.keyboard works fine, but with game.input.gamepad i get this error: " Failed to execute 'requestFullscreen' on 'Element': API can only be initiated by a user gesture." Is there a way to modify phaser.js to recognize the gamepad as a valid user gesture for fullscreen? game.input.gamepad.pad1.onDownCallback = function (button) { if (button === 9){ game.scale.fullScreenScaleMode = Phaser.ScaleManager.SHOW_ALL; if (game.scale.isFullScreen) { game.scale.stopFullScreen(); } else { game.scale.startFullScreen(false); } } } Link to comment Share on other sites More sharing options...
Osric Posted September 5, 2018 Share Posted September 5, 2018 Use onUp or onTap as the signals to execute the "go full screen" functionality from. onDown won't work ( as you have discovered ) Link to comment Share on other sites More sharing options...
Kosmoon Posted September 21, 2018 Author Share Posted September 21, 2018 onTap is a mouse or touch signal, onUp is onUpCallback for gamepad and it doesn't allow fullscreen too. Link to comment Share on other sites More sharing options...
Recommended Posts