Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

phaser create animation without frame names

 preload ()
    {
        this.load.atlas('zombie', 'assets/tests/zombie-no-pivot.png', 'assets/tests/zombie-no-pivot.json');
    }

    create ()
    {
        //  Here we just pass the texture atlas key to `create` and it will extract all frames
        //  from within it, numerically sorting them for the animation.
        this.anims.create({
            key: 'walk',
            frames: 'zombie',
            frameRate: 12,
            repeat: -1
        });

        this.add.sprite(400, 300).play('walk');
    }
Source by github.com #
 
PREVIOUS NEXT
Tagged: #phaser #create #animation #frame #names
ADD COMMENT
Topic
Name
7+5 =