lukaMis Posted June 23, 2014 Share Posted June 23, 2014 Hi I am using it like this:var gameWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;var gameHeight = window.innerHeight || document.documentElement.clientHeight ||document.body.clientHeight;...game = new Phaser.Game(gameWidth, gameHeight, Phaser.AUTO, 'MainGameState' );Is there any better or more used approach within Parser? tnxLuka Link to comment Share on other sites More sharing options...
lewster32 Posted June 23, 2014 Share Posted June 23, 2014 Within Phaser you can also call game.scale.setScreenSize() to attempt to resize the game canvas to the screen size, however I believe this will scale rather than truly resize. You can alternatively use setMaximum to set the width and height to the innerWidth and innerHeight of the document. Link to comment Share on other sites More sharing options...
lukaMis Posted June 24, 2014 Author Share Posted June 24, 2014 Hmm. For my first really simple game i do not need resize of whole game. Also i need game area to be as big as browser of device is. I check how big browser area that contains game is and then initialize game accordingly. I do scale down assets if i have less than 768 px (less than portrait iPad). How about portait and landscape modes. Are there any build in methods in Parser to deal with that?I know that i can't force desired mode from html5.Is the only thing i can do put game to pause and encourage user to switch back via css media queries? Link to comment Share on other sites More sharing options...
lewster32 Posted June 24, 2014 Share Posted June 24, 2014 You should probably look at this project template, which will answer your questions: https://github.com/photonstorm/phaser/tree/master/resources/Project%20Templates/Full%20Screen%20Mobile clark, Mike and lukaMis 3 Link to comment Share on other sites More sharing options...
lukaMis Posted June 24, 2014 Author Share Posted June 24, 2014 @lewster32 tnx for teh link. Link to comment Share on other sites More sharing options...
Recommended Posts