Jump to content

RESIZE scale mode not resizing as I expect when rotating the game (500x800 becoming 500x313 instead of 800x500)


rroylance
 Share

Recommended Posts

Hi all,

Hopefully, this is just something quick I'm missing... I have initialized my game with the resolution of 500x800 and SCALE_MODE is set to RESIZE; In portrait orientation, the game is the correct size of 500x800, however, when I rotate the device and would expect the game to now be 800x500 it is actually 500x313.

I'm thinking I'm just missing something that I need to manually resize or update or something, but I'm having trouble finding what I need by searching around.

Anyone know how to accomplish what I'm expecting?

Thanks.

Link to comment
Share on other sites

Mmm... maybe you could try wich one of the two types of resize you can use in Phaser:

// Stretch to fill

game.scale.scaleMode = Phaser.ScaleManager.EXACT_FIT;

 

//Stretch until one of the side touch the screen border

game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;

 

It seems that you are now using the second one (who is te default value).

You even want to rotate all the stage or just change it's size?

Link to comment
Share on other sites

I'm using RESIZE mode not the default SHOW_ALL. I do not want anything to be stretched at all so I used RESIZE which is supposed to simply update the stage to be the same size as the window leaving the scaling intact.

I simply want the game size to be updated, not rotated or scaled at all, and I'm going to handle all the positioning and scaling of things; I am making the game to work in both portrait and landscape resolutions with different layouts and such to accommodate the screen space available.

So when you rotate the phone I do not want the game to actually rotate, just update the size of the canvas.

Sorry if I repeated myself a few times, just trying to explain as clearly as I can.


Thanks.

Link to comment
Share on other sites

  • 2 weeks later...
On 12/21/2017 at 6:25 PM, samme said:

I would first set game.scale.parentIsWindow = true and see if that makes a difference.

Sorry for the delay, as with most people I was on Holiday. Hope you all had a great time with the families or whatever you may have done :)

On the topic at hand; the same result, my canvas is already parented to the window anyway.

Note that it also has the same resolution when started in landscape mode as well, so it's not just a result of starting the game in portrait and rotating it. There must just be a setting I'm missing... hmm.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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