Jump to content

Scale "BUG" version 2.2.2


i3Designer
 Share

Recommended Posts

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.
 

post-7059-0-41292400-1423081371_thumb.pn

post-7059-0-24629000-1423081377_thumb.pn

Link to comment
Share on other sites

  • 2 weeks later...

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

  • 4 weeks later...

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

  • 1 month later...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...