i3Designer Posted February 4, 2015 Share Posted February 4, 2015 In 2.2.2 version i have a little problem with scaleMode.I used: this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; this.scale.pageAlignHorizontally = true; this.scale.pageAlignVertically = true; this.scale.setScreenSize(true);I would like to use 2.2.2 version but i have this problem (look images)Same code between version 2.2.2 and 2.0.5. Link to comment Share on other sites More sharing options...
Kebrian Posted February 5, 2015 Share Posted February 5, 2015 I did have the same problem. Height seems not scale properly . I fixed it by deleting parent container (like #gameDiv) and putting canvas right in body. Link to comment Share on other sites More sharing options...
slk Posted February 17, 2015 Share Posted February 17, 2015 Hi Kebrian, It's impossible to use a div container for create Phaser object ?I explain my problem. Before the version 2.2, my canvas game automatically resized relative to the size of the screen with this method : For HTML :<body> <!-- div parent which will contains the canvas game --> <div id="divGame"></div></body>For Javascript (game resize) :// Phaser objectvar game = new Phaser.Game(SAFE_ZONE_WIDTH, SAFE_ZONE_HEIGHT, Phaser.AUTO, 'divGame');...// Game resize relative screen sizegame.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;game.scale.setShowAll();window.addEventListener('resize', function () { game.scale.refresh();});game.scale.refresh();Of course, the problem is that method not working now... I know that one solution is to remove the parent div and integrate the Phaser object directly to body with "new Phaser.Game(SAFE_ZONE_WIDTH, SAFE_ZONE_HEIGHT, Phaser.AUTO, '')" but I need to keep this div parent to integrate it as I want in my HTML page... Do you have a solution with this version of Phaser ? Thank you =) Link to comment Share on other sites More sharing options...
slk Posted March 14, 2015 Share Posted March 14, 2015 I finally found ! This code :// Game resize relative screen sizegame.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;game.scale.setShowAll();window.addEventListener('resize', function () { game.scale.refresh();});game.scale.refresh();Must be replaced by this code :// Game resize relative screen sizegame.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;game.scale.parentIsWindow = true; Link to comment Share on other sites More sharing options...
i3Designer Posted May 7, 2015 Author Share Posted May 7, 2015 game.scale.parentIsWindow = true ;Thank you SLK Link to comment Share on other sites More sharing options...
Recommended Posts