Set a global dirty flag on resize
This adds a global "Dirty" flag at the Game level and sets it each time the ScaleManager is modified. This fixes a bug where the game was not redrawn when a CoWebsite was opening/closing.
This commit is contained in:
+1
-8
@@ -127,19 +127,12 @@ const config: GameConfig = {
|
||||
//const game = new Phaser.Game(config);
|
||||
const game = new Game(config);
|
||||
|
||||
waScaleManager.setScaleManager(game.scale);
|
||||
waScaleManager.setGame(game);
|
||||
|
||||
window.addEventListener('resize', function (event) {
|
||||
coWebsiteManager.resetStyle();
|
||||
|
||||
waScaleManager.applyNewSize();
|
||||
|
||||
// Let's trigger the onResize method of any active scene that is a ResizableScene
|
||||
for (const scene of game.scene.getScenes(true)) {
|
||||
if (scene instanceof ResizableScene) {
|
||||
scene.onResize(event);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
coWebsiteManager.onResize.subscribe(() => {
|
||||
|
||||
Reference in New Issue
Block a user