spine icon indicating copy to clipboard operation
spine copied to clipboard

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

Open f0nar opened this issue 1 year ago • 1 comments

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 avatar Dec 21 '23 08:12 f0nar

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

f0nar avatar Jan 04 '24 13:01 f0nar