question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adding custom loaders in Assets.init doesn't work in Pixi 6.5.8

See original GitHub issue

Expected 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

Environment

  • pixi.js version: 6.5.8
  • Browser & Version: Brave
  • OS & Version: Windows

Screenshots

image image

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:closed
  • Created 10 months ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
bigtimebuddycommented, Nov 8, 2022

Yes extensions.add

1reaction
Giacomcommented, Nov 8, 2022

See other answers below if your parser order doesn’t matter.

I had a workaround for v6 by doing this:

Assets.loader.parsers.push(loadXML);

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.

Assets.loader.parsers.splice(0, 0, loadXML);

Sadly means I can’t use XML for bitmap fonts now but it works.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found