Jonny Shaw

TexturePacker Animations Problem

Recommended Posts

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;

 

Annotation 2019-01-02 123613.jpg

Share this post


Link to post
Share on other sites
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)

Annotation 2019-01-02 125030.jpg

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.