Jump to content

Sprite Atlas Issue


Zef
 Share

Recommended Posts

Hi there,

 

I am currently using Phaser for a University assignment and absolutely love it! Despite this I am having an issue trying to get a sprite atlas to work.

 

I have created a sprite sheet and corresponding atlas using shoebox and I am loading it into the game like so:

game.load.atlasXML('bee', 'assets/images/bee/beeAtlas.png', 'assets/images/bee/beeAtlas.xml');

I think everything is working fine at this point.

 

Then within my Bee object I am doing the following:

this.sprite = game.add.sprite(50, 50, 'bee');this.sprite.animations.add('fly', Phaser.Animation.generateFrameNames('fly', 1, 11, '', 2), 30, true);this.sprite.animations.play('fly');

For some reason this isn't working and I am getting the error:

TypeError: 'null' is not an object (evaluating 'this.currentFrame.uuid')

Has anyone got any idea why this might be? I should note that I been able to get animation working fine without an atlas, but I would like to use an atlas now so I can switch easily.

 

I have attached the sprite sheet and atlas as well for you to take a look.

 

Thanks in advance!

post-7386-0-55624600-1394151462.png

beeAtlas.xml

Link to comment
Share on other sites

  • 1 year later...
 Share

  • Recently Browsing   0 members

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