parwaniprakash Posted November 6, 2014 Share Posted November 6, 2014 Hello everyone, I stuck one of the issue. My client needs the game which is fit in all the screen. I have done most of code for game but didnt know how to fit the game according to screen resolution. It could be mobile or desktop screen. Thanks in advance parwaniprakash 1 Link to comment Share on other sites More sharing options...
Liranan Posted November 6, 2014 Share Posted November 6, 2014 Hello parwanikaprash I just found a code that works fine and do exactly what you're looking for: If you have a 'boot.js' file, you can put these lines on the 'create' function game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;game.scale.pageAlignHorizontally = true;game.scale.pageAlignVertically = true;game.scale.setScreenSize(true);I tried it and works wonderful.Hope I helped you! Gonzalo. Link to comment Share on other sites More sharing options...
parwaniprakash Posted November 7, 2014 Author Share Posted November 7, 2014 sorry but didnt get your answer..here I am writing my code for phaser v 2.0.3 var game = new Phaser.Game(1280, 800, Phaser.CANVAS, '', { preload: preload, create: create, update: update, render: render }); should I replace this code with your given code... Thanks in advance. Link to comment Share on other sites More sharing options...
parwaniprakash Posted November 7, 2014 Author Share Posted November 7, 2014 Ok got it.. this above code has to be write in create function.. got it.. thanks.. Link to comment Share on other sites More sharing options...
Recommended Posts