AssetManager.ts

src/systems/AssetManager.ts
import { 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

Support

Talk to the developers of this project to learn more

We have been building professional websites for big clients for over 15 years. Gallop templates and blocks is our best foundation for SEO websites and web apps.

© 2026 Web Plant Media, LLC