Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Atlas raw text data is returned if { images } metadata is passed #537

Open
f0nar opened this issue Dec 21, 2023 · 1 comment
Open

Atlas raw text data is returned if { images } metadata is passed #537

f0nar opened this issue Dec 21, 2023 · 1 comment

Comments

@f0nar
Copy link

f0nar commented Dec 21, 2023

Issue happens if I try to load TextureAtlas with preloaded images.
For that you need to pass { images } as third parameter to Assets.add.

PIXI.Assets.add(resource.name, resource.file, { images });
const result = await PIXI.Assets.load<pixi_spine.TextureAtlas>(resource.name);

In this case as we pass images metadata to control loading pipeline so we execute this block and as images are already loaded then textures fetching is sync unlike here. It makes texture atlas to be parsed eventually and call resolve callback earlier than retval is initialized. So pixi atlas parser returns undefined which will be skipped by pipeline and replaced with raw atlas text

Reproduced on
pixi.js: 7.3.0
pixi-spine: 4.0.4

@f0nar
Copy link
Author

f0nar commented Jan 4, 2024

In addition it throws error if you try to unload textureAtlas as loaded value is string so it does not have dispose method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant