How does this animation play?
test|369x500
test.json (697 Bytes)
How does this animation play?
test|369x500
test.json (697 Bytes)
I don’t have time right now to do better than provide some clues.
In preload you’ll do something like:
this.load.multiatlas("animateMe",
assets/graphics/test.json, "assets/graphics");
Before you can use the animation you have to create it, similar to:
var frameNames = this.game.anims.generateFrameNames('animateMe', { start: 0, end: 7, prefix: 'dongzou_000' });
this.anims.create({key:'dongzou', frames:frameNames, frameRate:10});
Create a sprite where you want it to display:
var test = new Sprite(this, 100,100, "animateMe", "dongzou_0000");
And finally, play the animation:
test.anims.play('dongzou');
If that doesn’t work, it’s close. Good luck!
This Article can help
Phaser 3 animations using local JSON File
thank you for your help
Animation can now be played
anchor doesn’t seem to work