Adding custom loaders in Assets.init doesn't work in Pixi 6.5.8
See original GitHub issueExpected Behavior
It’s possible to add a custom loader by calling Assets.init
Current Behavior
It’s not possible to add a custom loader by calling Assets.init (tested on DDS loader)
Possible Solution
Maybe there’s some missing code for adding loaders in Assets.init
Steps to Reproduce
- Download this repository with this branch: https://github.com/mterczynski/pixi-assets-testing/tree/pixi_6
- Run npm install
- Run npm start
- Take a look at the console
Environment
pixi.js
version: 6.5.8- Browser & Version: Brave
- OS & Version: Windows
Screenshots


Extra thoughts
This works on PixiJS version 7 (main branch in the linked repository) but the DDS loader is added there by default so I’m not able to test if Assets.init is fixed on PIXI 7
Issue Analytics
- State:
- Created 10 months ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Documentation insufficient for v6.x explaining that @pixi ...
Loader is being replaced with Assets in the next major release. Try Assets now by installing @pixi/assets to your project.
Read more >Assets - PixiJS
The Assets package is a modern replacement for the old PIXI.Loader class. It is a promise-based resource management solution that will download, cache...
Read more >How Does Asset Loading Work With Pixi.js?
Okay, so a lot of the tutorials for Pixi.js seem a bit outdated. ... const loader = PIXI.loader .add('image1', '/assets/images/image1.png').
Read more >PIXI.Assets - PixiJS API Documentation
More types can be added fairly easily by creating additional loader parsers. Textures. Textures are loaded as ImageBitmap on a worker thread where...
Read more >Loading a spritesheet in Pixijs does not work - Stack Overflow
The solution is to move spriteSheet.json with spriteSheet.png from assets to public folder. And set path images/spriteSheet.json (in ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes
extensions.add
See other answers below if your parser order doesn’t matter.
I had a workaround for v6 by doing this:Though I was having trouble because the other parsers would think the XML is a BitmapFont (even though the testParse() failed) so I then had to insert it at the start.
Sadly means I can’t use XML for bitmap fonts now but it works.