parwaniprakash Posted November 6, 2014 Report 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 Quote Link to comment Share on other sites More sharing options...
Liranan Posted November 6, 2014 Report 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. Quote Link to comment Share on other sites More sharing options...
parwaniprakash Posted November 7, 2014 Author Report 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. Quote Link to comment Share on other sites More sharing options...
parwaniprakash Posted November 7, 2014 Author Report Share Posted November 7, 2014 Ok got it.. this above code has to be write in create function.. got it.. thanks.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.