The Assets API is PixiJS's asset loader, resolver, and cache in one singleton. Use it to load textures, video, spritesheets, fonts, JSON, and other resources with format detection, resolution switching, bundle grouping, progress tracking, and GPU cleanup.
Quick Start
Assets.init() is optional but recommended for setting basePath, texturePreference, or a manifest. After init, call Assets.load() with a URL, alias, array, or UnresolvedAsset; resolved assets are cached and re-resolved by Assets.get().
Supported file types
The Parser ID column is the value you pass to the top-level parser field on an asset descriptor to force a specific loader. See "Forcing a parser" below.
Forcing a parser with parser
By default, PixiJS picks a loader by matching the file extension or MIME type. When your URL lacks an extension (CDN signed URLs, blob URLs, API endpoints, content-hashed paths), the resolver can't tell the loader what to do. Set the top-level parser field on the asset descriptor to force a specific loader:
The parser field goes at the top level of the asset descriptor (alongside src and data), not inside data. It takes any parser ID from the "Supported file types" table above:
'texture','svg','video': image, SVG, and video textures'json','text': JSON and plain text'web-font','bitmap-font': web and bitmap fonts'spritesheet': texture atlas JSON'gif': animated GIFs (requires'pixi.js/gif')'basis','dds','ktx','ktx2': compressed textures (each requires its side-effect import)
When you need it
- Signed CDN URLs:
https://cdn.example.com/get?id=abc123has no extension the loader can test against. - Blob or ObjectURL:
URL.createObjectURL(blob)producesblob:...URLs with no extension. - Custom routing:
/api/assets/hero-v2where the server decides the content type. - Content-hashed paths without suffix: some build pipelines produce names like
/static/abc123definstead of/static/abc123def.png.
If the URL does have an extension, you don't need parser; let auto-detection do its job. Only set parser when detection can't work.
loadParser is deprecated
The v7 loadParser field still works but emits a deprecation warning. Use parser for new code.
Topics
Every asset workflow is covered in a reference file. Pick the one that matches the question:
Decision guide
- Need to load a single image? Use
Assets.load(url). No setup required. - Loading many assets grouped by level/scene? Use a bundle. See
references/bundles.md. - Know all assets at build time? Use a manifest in
Assets.init. Seereferences/manifests.md. - Need a loading bar? Pass a progress callback to
Assets.load. Seereferences/progress.md. - Smooth transitions between levels? Background-load the next level. See
references/background.md. - Memory budget matters? Use compressed textures and
Assets.unloadbetween screens. Seereferences/compressed-textures.mdandreferences/caching.md. - Need crisp SVG icons at any size? Load as Graphics, not texture. See
references/svg.md. - Retina + WebP/AVIF? Configure
texturePreferenceand use format patterns. Seereferences/resolution.md.
Load options and error handling
There are two separate "options" concepts when loading assets:
LoadOptions: the second argument toAssets.load/loadBundle. Controls error recovery, retries, progress, and completion callbacks across a whole load.data: a field on each asset descriptor. Forwards parser-specific options (scale mode, resolution, font family, autoplay flags, etc.) to the specific loader for that asset.
LoadOptions (per call)
onProgress(progress):[0, 1]as assets in the call complete.onError(error, url):urlisstring | ResolvedAsset. Guard before reading.src; whenurlis a string,.srcis undefined.strategy: 'throw' | 'skip' | 'retry'— default'throw'.'skip'resolves with any successful assets;'retry'reattempts the failed ones.retryCount— default3, retries per asset whenstrategyis'retry'.retryDelay— default250ms between retries.
Global defaults live on Loader.defaultOptions, or pass loadOptions to Assets.init().
data options (per asset)
Each loader parser reads its own options from the data field on the asset descriptor. Use the table below to pick the right options for each asset type:
Example combining LoadOptions and data:
Inside a manifest or bundle, every entry can carry its own data:
Runtime configuration
Assets.init(options) accepts, alongside basePath and manifest:
defaultSearchParams— string orRecord<string, any>appended to every resolved URL. Useful for cache busting.skipDetections: boolean— bypass browser format detection for faster init. Requires explicittexturePreference.format.bundleIdentifier: BundleIdentifierOptions— customize how bundle keys resolve so the same alias can live in multiple bundles.loadOptions: Partial<LoadOptions>— set the defaultstrategy,retryCount,retryDelay, and callbacks for every subsequentAssets.loadcall.preferences: Partial<AssetsPreferences>—crossOrigin,preferWorkers,preferCreateImageBitmap,parseAsGraphicsContext.
After init, preferences can still be tuned:
Assets.setPreferences(preferences)— push new preferences to every parser that supports them.Assets.detections— getter exposing the registeredFormatDetectionParserlist; use when inspecting what formats the current environment advertises.Assets.reset()— internal full reset (resolver + loader + cache). Intended for tests so a freshAssets.initcan run.
Common Mistakes
[CRITICAL] Using Texture.from(url) to load
Wrong:
Correct:
In v8, Texture.from() only reads the cache. It does not fetch from a URL. Use Assets.load() first; the return value is the texture itself.
[HIGH] Using positional Assets.add signature
Wrong:
Correct:
The positional Assets.add(key, url) form was removed in v8. Use the options object with alias and src properties.
[HIGH] Not unloading textures between levels
Assets.load() caches textures indefinitely. For level-based games or screens with distinct asset sets, call Assets.unloadBundle() when transitioning to release GPU memory.


