loading-assets

Automate asset loading in Phaser scenes with preload pipelines.

40.1k|7.2k|Updated Apr 12, 2013
One-click install
npx skills add https://github.com/phaserjs/phaser --skill loading-assets-phaserjs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: loading-assets
Source: https://github.com/phaserjs/phaser/tree/main/skills/loading-assets
Command: npx skills add https://github.com/phaserjs/phaser --skill loading-assets-phaserjs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Loading assets in Phaser can be error-prone and repetitive, requiring careful queuing, loading order, and global cache management across scenes. This skill consolidates the LoaderPlugin usage, asset types, and load events to ensure assets are available when needed and to provide a consistent loading workflow.

Core Features & Use Cases

  • Centralized asset loading with this.load (images, atlases, audio, JSON, tilemaps, fonts) using preload() patterns.
  • Automatic loader start and per-file progress events, with assets cached in the global texture and cache systems for cross-scene reuse.
  • Real-world use case: a multi-scene game loads a common sprite sheet and maps in preload() once, and uses them across scenes without reloading.

Quick Start

Queue assets in preload() and rely on automatic loader progression to ensure all assets are ready before create().

Frequently Asked Questions about loading-assets

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I preload sprites and tilemaps in a Phaser scene?

To preload sprites and tilemaps in a Phaser scene, queue assets in the preload() method using this.load. The loader automatically progresses to ensure all images, atlases, and JSON files are cached and ready before create() runs.

How does the Phaser LoaderPlugin cache assets across multiple scenes?

The Phaser LoaderPlugin caches loaded assets in global texture and cache systems during preload(). This allows multiple scenes to reuse the same sprite sheets and maps without reloading, ensuring deterministic asset availability.

Can I track load progress for audio and JSON files in Phaser?

Yes, you can track load progress for audio and JSON files in Phaser. The LoaderPlugin provides per-file progress events during the preload pipeline, allowing you to monitor loading status before transitioning between scenes.

Does Phaser support loading atlases and audio globally for cross-scene reuse?

Yes, Phaser supports loading atlases and audio globally. By queuing these assets in a preload() pipeline, the LoaderPlugin caches them for cross-scene reuse, preventing repetitive loading and ensuring consistent availability.

Why are my Phaser assets not available in the create method?

Phaser assets are not available in the create method if they are not properly queued in preload(). Deterministic asset loading requires using this.load to queue files, ensuring the automatic loader starts and finishes before create() executes.