
Pixijs Assets
Preload PixiJS textures and bundles in the background during menus or splash screens so level transitions feel instant for indie game and canvas apps.
Overview
pixijs-assets is an agent skill for the Build phase that documents PixiJS non-blocking background asset and bundle loading patterns.
Install
npx skills add https://github.com/pixijs/pixijs-skills --skill pixijs-assetsWhat is this skill?
- Non-blocking `backgroundLoad`, `backgroundLoadBundle`, and array queues for sequential main-thread-safe prefetch
- Pair background prefetch with later `Assets.load` / `loadBundle` for fast resolve when the player needs the asset
- Manifest and bundle-oriented workflow aligned with PixiJS `Assets.init` configuration
- Fire-and-forget pattern for priming the next level while the current scene runs
- Single-asset and multi-asset background queue patterns with documented quick-start flow
Adoption & trust: 1.4k installs on skills.sh; 206 GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You block the main thread or stall level transitions because every texture loads only when the player clicks start.
Who is it for?
Indie builders shipping PixiJS web or hybrid games who need splash-screen or between-level prefetch without rewriting the whole loader.
Skip if: Teams not using PixiJS Assets, or projects that only need one synchronous load at startup with no progressive content.
When should I use this skill?
Implementing PixiJS level transitions, bundle manifests, or splash-screen preload where blocking `Assets.load` is too slow.
What do I get? / Deliverables
You queue bundles and URLs with background APIs and bind gameplay to fast `load`/`loadBundle` handoffs when content is needed.
- Background-load call sites paired with on-demand load handlers
- Level or menu transition code using prefetch queues
Recommended Skills
Journey fit
How it compares
Use for PixiJS Assets cache semantics instead of ad-hoc `fetch` plus manual texture creation.
Common Questions / FAQ
Who is pixijs-assets for?
Solo and indie developers building PixiJS games or rich canvas UIs who want background prefetch during menus and gameplay.
When should I use pixijs-assets?
During Build when wiring level flows, splash screens, or bundle manifests; also when debugging hitches before Ship perf passes on web games.
Is pixijs-assets safe to install?
Review the Security Audits panel on this Prism page before installing; the skill is documentation-only and does not grant shell or network permissions by itself.
SKILL.md
READMESKILL.md - Pixijs Assets
# Background Loading Background loading lets PixiJS fetch and prepare assets passively while other work happens. Use it to prime the next level while the current one is playing, preload assets during a splash screen, or prepare UI assets during initial load. `backgroundLoad` and `backgroundLoadBundle` are non-blocking and return immediately. ## Quick Start ```ts await Assets.loadBundle("menu"); showMenu(); Assets.backgroundLoadBundle("level1"); playerClicksStart(() => { Assets.loadBundle("level1").then(() => startLevel()); }); ``` The `backgroundLoadBundle` call starts loading `level1` immediately without blocking. The later `loadBundle` call resolves quickly if background loading finished in the meantime. ## Core Patterns ### Background-loading a single asset ```ts Assets.backgroundLoad("images/level2-assets.png"); // later, when we need it: const texture = await Assets.load("images/level2-assets.png"); ``` Fire-and-forget. Background loading happens one asset at a time to avoid blocking the main thread. When your code later calls `Assets.load(url)` for the same asset, it either resolves immediately (if background work finished) or waits for the already-in-progress load. ### Background-loading an array ```ts Assets.backgroundLoad([ "images/sprite1.png", "images/sprite2.png", "images/background.png", ]); ``` Queues multiple assets for background loading. They're processed sequentially. ### Background-loading a bundle ```ts await Assets.init({ manifest: { bundles: [ { name: "home", assets: [{ alias: "bg", src: "home-bg.png" }] }, { name: "level-1", assets: [{ alias: "map", src: "level1-map.json" }] }, ], }, }); await Assets.loadBundle("home"); showHome(); Assets.backgroundLoadBundle("level-1"); onPlayClicked(async () => { await Assets.loadBundle("level-1"); startLevel(); }); ``` Same idea for bundles. Bundle assets are queued one at a time. Requires the bundle to exist via the manifest or `addBundle`. ### Interrupting background loading ```ts Assets.backgroundLoadBundle("level-2"); onPlayerDecidedLevel3(async () => { await Assets.loadBundle("level-3"); }); ``` Calling `Assets.load()` or `Assets.loadBundle()` interrupts background loading safely. The current background asset finishes, then the explicit load takes priority. Your explicit load resolves normally. ### Combining with a progress bar Background loading has no progress callback; it runs silently. To show a loading bar, use `Assets.loadBundle(name, onProgress)` in the foreground instead. Typical pattern: use background loading for nice-to-have preloads and foreground loading for the bundles you're actually waiting on. ## Common Mistakes ### [HIGH] Expecting progress from background loading Wrong: ```ts Assets.backgroundLoadBundle("level2", (p) => updateBar(p)); ``` Correct: ```ts Assets.backgroundLoadBundle("level2"); // show a spinner or no UI while it runs ``` `backgroundLoad` and `backgroundLoadBundle` don't accept progress callbacks. They're silent. For visible progress, use the foreground `Assets.load` / `Assets.loadBundle` with an `onProgress` argument. ### [MEDIUM] Assuming background load completes before next foreground load Wrong: ```ts Assets.backgroundLoadBundle("level-2"); setTimeout(() => startLevel2(), 0); ``` Correct: ```ts Assets.backgroundLoadBundle("level-2"); onStart(async () => { await Assets.loadBundle("level-2"); startLevel2(); }); ``` Background loading is best-effort. If the player hits Start before it finishes, the foreground `loadBundle` still needs to await the remaining work. Always `await` the real load before using the assets. ### [MEDIUM] Background-loading assets that are never used Each queued background load consumes bandwidth and GPU memory. If the player never visits level 2, you've wasted that bandwidth. Background-load only what you're confident will be needed soon. ## API Reference - [Assets](https://pixijs.download/release/docs/assets.Assets.h