Jonny Shaw Posted January 2, 2019 Share Posted January 2, 2019 Hi all, been trying to use the .animations feature of texturepacker for a small animated icon, but for some reason It's not finding the animations object even though it's detected and visible in the generated json file? https://www.codeandweb.com/texturepacker/tutorials/how-to-create-sprite-sheets-and-animations-with-pixijs Any clues on something probably obvious that I'm missing here, or has something changed? Error I get is Cannot read property 'electron' of undefined. Have also tried adding both .spritesheet and .textures to the sheet declaration. If I use .textures in the sheet declaration and use a single sprite it is fine, so it's definately loading the json file correctly class ScoreIcon extends PIXI.Container{ constructor(){ super(...arguments); let sheet = PIXI.loader.resources["./assets/electronAtlas.json"]; this.sprite = new PIXI.extras.AnimatedSprite(sheet.animations["electron"]); this.addChild(this.sprite); } } export default ScoreIcon; Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted January 2, 2019 Share Posted January 2, 2019 Which version of pixi do you use? You have enough experience to open debugger and look inside spritesheet loader to ensure that json animations were parsed correctly. Quote Link to comment Share on other sites More sharing options...
Jonny Shaw Posted January 2, 2019 Author Share Posted January 2, 2019 6 minutes ago, ivan.popelyshev said: Which version of pixi do you use? You have enough experience to open debugger and look inside spritesheet loader to ensure that json animations were parsed correctly. Currently on 4.8.1 but just updating that now. No errors in loading it in the debugger that I can see (if I'm looking in the right place here) Quote Link to comment Share on other sites More sharing options...
Jonny Shaw Posted January 2, 2019 Author Share Posted January 2, 2019 11 minutes ago, ivan.popelyshev said: Which version of pixi do you use? You have enough experience to open debugger and look inside spritesheet loader to ensure that json animations were parsed correctly. thanks Ivan looks like updating to 4.8.4 has fixed it ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted January 2, 2019 Share Posted January 2, 2019 That's because @AndreasLoew made PR for us: https://github.com/pixijs/pixi.js/pull/5011/ Jonny Shaw 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.