Jump to content

Mobile Show_all + FullScreen


Tanikaze
 Share

Recommended Posts

Sorry for the Yet Another RePost, but I have problems with the ScaleManager.

 

Here are my mobile settings (same as the Fullscreen template)

this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;this.scale.setMinMax(480, 260, 1024, 768);this.scale.pageAlignHorizontally = true;this.scale.pageAlignVertically = true;this.scale.forceOrientation(true, false);this.scale.setResizeCallback(this.gameResized, this);this.scale.enterIncorrectOrientation.add(this.enterIncorrectOrientation, this);this.scale.leaveIncorrectOrientation.add(this.leaveIncorrectOrientation, this);

All works as intended except that, when in landscape, the div fit the width and maintains the ratio on the height, instead to fit the height and maintain the ration on the width. What's wrong?

Link to comment
Share on other sites

I I hacked the problem myself, getting the screen size and set that (minus a 10% margin) as min and max dimensions. However, I still cannot understand why the code above would  fit the biggest dimension instead the smallest.

 

Here is the code, for wanderers' good

this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;var maxWidth = screen.width - screen.width/10;var maxHeight = screen.height - screen.height/10;this.scale.setMinMax(maxWidth, maxHeight, maxWidth, maxHeight);
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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