Phaser: Game.resize not working properly (Phaser 3.2)

Created on 1 Mar 2018  路  5Comments  路  Source: photonstorm/phaser

I have updated the code here to use the master branch version to test game.resize() function here

The canvas is resized, but it seem phaser stage is not (you can see it by playing with the browser dimensions as my text is always centered in the browser window)

In canvas mode, i see the background-color get resized, but not in WebGL. Both modes show that the Phaser stage is not resized correctly.

Here is my setup code.

Thanks a bunch for your work!

All 5 comments

Can you post your code for the Menu scene as well please.

This is working properly in 3.4. I've updated the example to show how to use it properly with a window event + tile sprite: http://labs.phaser.io/view.html?src=srcgame%20configgame%20resize.js

Yes it does!

Thanks a bunch Rich!

@photonstorm as of 3.19 I'm seeing "TypeError: game.resize is not a function"

Example from Phaser 3 website is currently broken: https://phaser.io/examples/v3/view/game-config/game-resize#

Opened https://github.com/photonstorm/phaser/issues/4718

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sercand picture sercand  路  3Comments

samme picture samme  路  3Comments

samme picture samme  路  4Comments

halilcakar picture halilcakar  路  4Comments

lilijreey picture lilijreey  路  4Comments