All player textures are now lazy-loaded

This commit is contained in:
kharhamel 2021-01-07 17:11:22 +01:00
parent c2d0cda441
commit 472fbb1de0
15 changed files with 470 additions and 502 deletions

View file

@ -0,0 +1,14 @@
export const addLoader = (scene:Phaser.Scene): void => {
const loadingText = scene.add.text(scene.game.renderer.width / 2, 200, 'Loading');
const progress = scene.add.graphics();
scene.load.on('progress', (value: number) => {
progress.clear();
progress.fillStyle(0xffffff, 1);
progress.fillRect(0, 270, 800 * value, 60);
});
scene.load.on('complete', () => {
loadingText.destroy();
progress.destroy();
});
}