playh5 Posted December 22, 2013 Share Posted December 22, 2013 Hi!, I'd like to ask why setting full screen in Phaser can only be called using the input from the user game.input.onDown.add(gofull, this);function gofull(){ Phaser.StageScaleMode.EXACT_FIT = 0; game.stage.scale.startFullScreen(); alert('full screen');}When calling the function gofull() in the create function or update function, the game doesn't go full. Thanks in advance! Link to comment Share on other sites More sharing options...
rich Posted December 22, 2013 Share Posted December 22, 2013 It's a browser restriction, otherwise visiting a web site could just instantly make the site go full-screen without you being able to stop it at all. Which is of course a bad thing. Link to comment Share on other sites More sharing options...
playh5 Posted December 22, 2013 Author Share Posted December 22, 2013 Thanks for the reply Rich, So phaser made html5 game should have a "full screen" button first before loading the entire games. But most html5 games upon opening it would instantly go full screen. Link to comment Share on other sites More sharing options...
rich Posted December 22, 2013 Share Posted December 22, 2013 Be sure you understand the difference between true full screen, and just filling the browser window up. They're not the same thing. Going properly full-screen requires user permission / action to happen. Filling the browser doesn't. Link to comment Share on other sites More sharing options...
playh5 Posted December 22, 2013 Author Share Posted December 22, 2013 Thanks for the clarification Rich. Your explanation helps a lot. Link to comment Share on other sites More sharing options...
enpu Posted December 31, 2013 Share Posted December 31, 2013 You can use true full screen on browsers, that supports Full Screen API:http://caniuse.com/fullscreen Link to comment Share on other sites More sharing options...
Recommended Posts