Jump to content

Can't access/animate further spritesheetframes


user.src
 Share

Recommended Posts

Hi there,

I've got a strange problem. In my actual project I've got three spritesheets. Everyone works great. But now I can't access any further loaded Spritesheet. I add it like I add all the other spritesheets before. I also tried to add another sprite, but it doesnt work neither.

This is one of the testsprites:

testsprite_8x24.png

this is my preload code:

this.load.spritesheet('testsprite', './assets/images/testsprite_8x24.png', 8, 24);

And this is the way I add/access it:

this.testsprite = this.add.sprite(0, 0, 'testsprite');
this.testsprite.frame = 1;

Phaser always adds the complete sprite into the scene, not frame 1 though. If I add an animation it doesn't work neither, although testsprite.animations.currentAnim.isPlaying returns true.

As I mentioned before in this way I successfully added three other sprites. I can't imagine but: Is there a limit for spritesheets?!

Link to comment
Share on other sites

Looks like you're specifying the whole spritesheet size in the loader (8x24), instead of each frame's size (8x8). I guess Phaser's playing the animation, but the animation would consist of just one 8x24 frame instead of three 8x8 frames.

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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