xdiepx Posted March 16, 2014 Share Posted March 16, 2014 The code below worked in previous version and it allowed me to re-size the canvas when the window re-sizes but it isn't working in 2.0.0? this.game.stage.scale.setScreenSize(true); this.game.stage.scale.setScreenSize is not a function If i comment it out it works but the screen doesn't re-size. It doesn't look like it has changed in library and the function setScreenSize doesnt appear on the console log too. anyways here is the rest of the code. if (this.game.device.desktop){ this.game.stage.scaleMode = Phaser.ScaleManager.SHOW_ALL; this.game.stage.scale.minWidth = 480; this.game.stage.scale.minHeight = 260; this.game.stage.scale.maxWidth = 1024; this.game.stage.scale.maxHeight = 768; this.game.stage.scale.pageAlignHorizontally = true; this.game.stage.scale.pageAlignVertically = true; this.game.stage.scale.setScreenSize(true);} Any ideas how it would work in 2.0.0? and thanks for the help. Link to comment Share on other sites More sharing options...
MarkAndrade Posted March 16, 2014 Share Posted March 16, 2014 I think you just need to remove 'stage' in the 2.0 api this.game.scaleMode = Phaser.ScaleManager.SHOW_ALL; this.game.scale.minWidth = 480; this.game.scale.minHeight = 260; this.game.scale.maxWidth = 1024; this.game.scale.maxHeight = 768; this.game.scale.pageAlignHorizontally = true; this.game.scale.pageAlignVertically = true; this.game.scale.setScreenSize(true); Link to comment Share on other sites More sharing options...
Chupup Games Posted March 16, 2014 Share Posted March 16, 2014 Have informations here under stage updates: https://github.com/photonstorm/phaser/blob/master/resources/Migration%20Guide.md Link to comment Share on other sites More sharing options...
xdiepx Posted March 17, 2014 Author Share Posted March 17, 2014 MarkAndrade: cheers mark. Chupup Games: thanks for the link. Link to comment Share on other sites More sharing options...
xdiepx Posted March 17, 2014 Author Share Posted March 17, 2014 Sorry about this but i just notice that the setScreenSize doesn't work. The whole stage doesn't re-size. Link to comment Share on other sites More sharing options...
rich Posted March 17, 2014 Share Posted March 17, 2014 Paste in the code you're using, but before doing that please look at the resources/Project Templates folder and the Boot.js files in there, as they show the updated way to do it. Also this bit from above:this.game.scaleMode = Phaser.ScaleManager.SHOW_ALL;Should be:this.game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;Or if you're using proper States you can just do it like this:this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;this.scale.minWidth = 480;this.scale.minHeight = 260;this.scale.maxWidth = 1024;this.scale.maxHeight = 768;this.scale.forceLandscape = true;this.scale.pageAlignHorizontally = true;this.scale.setScreenSize(true); AsuraBR, xdiepx and Finders_Keepers 3 Link to comment Share on other sites More sharing options...
xdiepx Posted March 17, 2014 Author Share Posted March 17, 2014 Thanks Rich. the last block of code works Link to comment Share on other sites More sharing options...
Recommended Posts