Merge pull request #17 from moufmouf/autoresize
Automatically resizing game when window is resized
This commit is contained in:
commit
214abc7a0a
@ -14,3 +14,7 @@ const config: GameConfig = {
|
||||
};
|
||||
|
||||
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