Outfire Posted August 23, 2017 Share Posted August 23, 2017 I want to use one atlas for many spine animations in my game. I found the way how to do it with loader. I am loaded atlas with game loader (name other.atlas) and got in game.loader.resources.other. Then i am trying to load json file of my animation from console. otherLoader = new PIXI.loaders.Loader() spineLoaderOptions = { metadata: { spineAtlas: 'game.loader.resources.other' } }; otherLoader.add('someJson', 'static/img/content/fullHD/machine/elements/testJ.json', spineLoaderOptions) .load() But it will not work. Loader still wants to load atlas with name of my json. GET http://localhost:3004/static/img/content/fullHD/machine/elements/testJ.atlas 404 (Not Found) I think it is because of atlas parser . I need varibale "pages" in my metadataAtlas, but there is no pages. How atlas data looks like in console. I am doing something wrong and i dont know what. ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted August 23, 2017 Share Posted August 23, 2017 You have to create "PIXI.spine.core.TextureAtlas", and use this method: https://github.com/pixijs/pixi-spine/blob/master/src/core/TextureAtlas.ts#L74 . Then pass it to the loader. Something like https://github.com/pixijs/pixi-spine/blob/master/examples/dynamic_texture_atlas.md , but you can just pass "resources['myAtlas'].textures" to addTextureHash. Btw, I'm working on automatic runtime atlas at the moment. Outfire 1 Quote Link to comment Share on other sites More sharing options...
Outfire Posted August 23, 2017 Author Share Posted August 23, 2017 Thanks! All is fine. ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.