resizing fixes
This commit is contained in:
parent
ea3d824b83
commit
b5de0dbe64
@ -22,7 +22,9 @@ const gameConfig = {
|
||||
}
|
||||
|
||||
const bootGame = (game: Phaser.Game) => {
|
||||
game.scale.resize(window.innerWidth, window.innerHeight);
|
||||
window.addEventListener('resize', () => {
|
||||
game.scale.resize(window.innerWidth, window.innerHeight);
|
||||
});
|
||||
}
|
||||
|
||||
const preloadScene = (scene: Phaser.Scene) => {
|
||||
@ -45,6 +47,10 @@ const bootScene = (scene: Phaser.Scene) => {
|
||||
});
|
||||
|
||||
const grid = scene.add.grid(0, 0, window.innerWidth, window.innerHeight, 64, 32, 0, 0, 0xff00ff, 0.5).setOrigin(0, 0);
|
||||
|
||||
window.addEventListener('resize', () => {
|
||||
grid.setSize(window.innerWidth, window.innerHeight);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user