Merge pull request #17 from moufmouf/autoresize
Automatically resizing game when window is resized
This commit is contained in:
commit
214abc7a0a
1 changed files with 4 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue