src/systems/AssetManager.tsimport { Assets, type AssetsManifest, type UnresolvedAsset } from 'pixi.js';/*** Wrapper around PixiJS's official Assets API.** Pixi handles caching, format detection (WebP/AVIF/PNG), and bundle loading* out of the box — we just expose a small surface for the typical game flow:** await assets.loadBundle({ player: 'sprites/player.png' });* const tex = assets.get('player');** For larger projects, switch to manifest-based bundles* (assets.initManifest(manifest)) so background-load-by-bundle becomes* one call.*/export class AssetManager {/** Initialize with a Pixi assets manifest (multi-bundle projects). */async initManifest(manifest: AssetsManifest): Promise<void> {await Assets.init({ manifest });}
Showing the first 20 lines.
Get full code