Jump to content

Scaling issues - Undefined Viewport sizes


Mudsworth
 Share

Recommended Posts

Hi Folks,

I'm writing a tetris clone and want the game's height to scale to fit different window sizes. The game runs perfectly at its native 400 x 800, and I want to scale the entire canvas to fit smaller screen sizes. I'm using  'game.stage.scaleMode = Phaser.ScaleManager.SHOW_ALL' in the preload(), but to no avail.

I've noticed in this Phaser demo that my ViewportWidth and ViewportHeight are undefined (tested on Firefox, Chrome, and Edge). I've a hunch that these values are used to determine the scale, and that being 'undefined' is stopping things from working. I could write in my own scaling using window heights etc, but that's a lot of double handling if Phaser can resize the whole canvas. Am I missing something?

Many thanks in advance!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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