Mudsworth Posted June 22, 2017 Share Posted June 22, 2017 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 More sharing options...
samme Posted June 22, 2017 Share Posted June 22, 2017 Should be game.scale.scaleMode. Link to comment Share on other sites More sharing options...
Mudsworth Posted June 25, 2017 Author Share Posted June 25, 2017 Hi Samme, I feel a bit silly for not noticing that. Many thanks! Link to comment Share on other sites More sharing options...
Recommended Posts