Automatically resizing game when window is resized
This commit is contained in:
parent
20c525c3a6
commit
9290dfd6c5
@ -14,3 +14,7 @@ const config: GameConfig = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let game = new Phaser.Game(config);
|
let game = new Phaser.Game(config);
|
||||||
|
|
||||||
|
window.addEventListener('resize', function (event) {
|
||||||
|
game.scale.resize(window.innerWidth / resolution, window.innerHeight / resolution);
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user