Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _resolveSpine(entry: any) {
- if(!entry.options || !entry.options.metadata || !entry.options.metadata.data)
- return;
- const pack = entry.options.metadata as IPacket;
- if(pack.mime != "application/json")
- return;
- const text = decodeURIComponent(pack.data.replace("data:application/json;,",""));
- const json = JSON.parse(unescape(text));
- if(!json.bones)
- return;
- const path = pack.path;
- const atlasPath = path.replace(".json", ".atlas");
- const imagePath = path.replace(".json", ".png");
- const imageRes = this.bundle[imagePath].data;
- const atlasRes = decodeURIComponent(this.bundle[atlasPath].data.replace("data:text/plain;,",""));
- const image = new Image();
- image.src = imageRes;
- entry.options.metadata.image = PIXI.BaseTexture.from(image);
- entry.options.metadata.atlasRawData = atlasRes;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement