All player textures are now lazy-loaded
This commit is contained in:
parent
c2d0cda441
commit
472fbb1de0
15 changed files with 470 additions and 502 deletions
14
front/src/Phaser/Components/Loader.ts
Normal file
14
front/src/Phaser/Components/Loader.ts
Normal 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();
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue