Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Scale Problem?


zelcard
 Share

Recommended Posts

         if (game.device.desktop)          {             game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;             game.scale.minWidth = 320;             game.scale.minHeight = 580;             game.scale.maxWidth = 720;             game.scale.maxHeight = 940;             game.scale.pageAlignHorizontally = true;             game.scale.pageAlignVertically = true;             game.scale.setScreenSize(true);          }         else          {               game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;             game.scale.minWidth = 320;             game.scale.minHeight = 580;             game.scale.maxWidth = 720;             game.scale.maxHeight = 940;             game.scale.pageAlignHorizontally = true;             game.scale.pageAlignVertically = true;             game.scale.forceOrientation(false, true, 'orientation');             game.scale.setScreenSize(true);             game.scale.fullScreenScaleMode = Phaser.ScaleManager.EXACT_FIT;         }

This is the code that handles the scale depending on the device the game runs on, it works but the problem is that the game doesn't fill the whole screen like you can see in the images below (red is game screen, white is the empty space that I need to fill to get full screen):

 

wdfGYyy.jpg

 

After playing around a bit I realized that somehow phaser scales screen only from the first part of the code (from the if (game.device.desktop) statment) no matter if its desktop or mobile device, what am I doing wrong?

 

PS

 

Have tried only with this part of code:

             game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;             game.scale.minWidth = 320;             game.scale.minHeight = 580;             game.scale.maxWidth = 720;             game.scale.maxHeight = 940;             game.scale.pageAlignHorizontally = true;             game.scale.pageAlignVertically = true;             game.scale.forceOrientation(false, true, 'orientation');             game.scale.setScreenSize(true);             game.scale.fullScreenScaleMode = Phaser.ScaleManager.EXACT_FIT;

and it works very good on mobile platforms but it looks awfully stretched on desktop.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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