pixijs/spine

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

f0nar opened this issue · 1 comments

f0nar commented

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 commented

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