Jump to content

Single animation from multipack Tecture Packer atlas


ptotheaul
 Share

Recommended Posts

I have a long animation that will not fit on a single 2048x2048 sprite sheet.  I need to keep the spritesheet/atlas that size though.  What is the best way to go about defining the animation.  With one Texture Packer spritesheet/atlas it looks like this:

caster = this.game.add.sprite(100, 100, 'caster', 'FIRE_00001.png');

animation = caster.animations.add('fire', Phaser.Animation.generateFrameNames('FIRE_000', 1, 23, '.png', 2), 30, true, false);

Where the sprite sheet is caster.json and caster.png.  With two sprite sheets the animations would be over two sprite sheets:

caster-1.png caster-1.json

and

caster-2.png caster-2.json

 

Since i have to preload both 'caster-1' and 'caster-2'  I can't just reference a single atlas 'caster'. 

Do I have to create two animations and call oncomplete functions to play the next?  It seems like there should be a simper way.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...