stasuss Posted May 6, 2014 Share Posted May 6, 2014 Hello All, In my game I use spritesheet with to rows. Each row contains 32 frames, 64 frames total. I need to define two animations. The only way I see is to use sprite.animations.add('key', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, .......Is this the only way, or does Phaser allows defining range of frames? EDIT: does Phaser support multirow spritesheets? I fail to use my spritesheet Link to comment Share on other sites More sharing options...
Alvin Posted May 6, 2014 Share Posted May 6, 2014 Hi, yes there is defintely a better way to do it, there it is :sprite.animations.add('key', game.math.numberArray(0,11),24,false);You can also have a look at this function : http://docs.phaser.io/Phaser.Animation.html#generateFrameNames which is even more powerful. Good luck PS : and yes it should work with your spritsheet. stasuss 1 Link to comment Share on other sites More sharing options...
Recommended Posts