How to change the game size


How can I change the game size / gameSize? I’m trying to set the game size to window’s size on resize event.
I tried to dig in to the game object to change the width and height but i guess those are just read only.


1 Like

but is there a way to directly change the game size?
I’m in the middle of a project and i have already implemented my own scale manager, the only problem with it is that if you start the game with small window size and then increase the windows size, the game size will not increase.


How would you change the scaleMode afterwards? I’m looking for something like .scale.fullScreenScaleMode was in Phaser 2 to switch from FIT to HEIGHT_CONTROLS_WIDTH. Or another way to show only wanted part of the game on fullscreen mode, but use the whole screen.


I think you can just assign to this.scale.scaleMode.


I’ve tried that, but it’s only a variable and nothing is using it after start. Something more is needed. I’ve tried updateScale and refresh too, but they don’t seem to be for this.

resize (gameSize, baseSize, displaySize, resolution)

    if(this.scale.isFullscreen) {

        console.log('set scalemode: ',Phaser.Scale.ScaleModes.HEIGHT_CONTROLS_WIDTH);

        this.scale.scaleMode = Phaser.Scale.ScaleModes.HEIGHT_CONTROLS_WIDTH;

        console.log('scalemode now : ', this.scale.scaleMode);


Hey @Mikko_Torniainen Could you be able find any solution about this ?