Jump to content

Phaser does not recognize spritesheet


SteveMavic
 Share

Recommended Posts

Hello, I've tried to make spritesheet but Phaser doesn't recognized that my image has frames. Phaser thinks, that my image has just one frame.
When I try to make animation, it's looks like this
fEjvxoq.gif

Code in gif

		zyla_zlota = game.add.sprite(800, game.world.height - 120, 'ZylaZlota');
		zyla_zlota.animations.add('left', [3, 2, 1, 0], 5, true);
		//game.physics.arcade.enable(zyla_zlota);
		zyla_zlota.animations.play('left');

Declaration

this.game.load.spritesheet('ZylaZlota', 'assets/images/ŻyłaZłotaFull.gif', 358, 85, 6);

 

Link to comment
Share on other sites

Impossible to tell without you posting the image you're using. However I see that it's a gif file. That will still work, as long as it's a proper sprite sheet (each frame next to one another), and not an animated gif. You can't use animated gifs in Phaser / Pixi games.

Link to comment
Share on other sites

It's a gif format but it's normal picture and I want to say that I'm dumb, because 358px is a full width of picture, in that case ~60px per frame, so It should be

this.game.load.spritesheet('ZylaZlota', 'assets/images/ŻyłaZłotaFull.gif', 60, 85, 6);

Sorry for making dumb question.
Topic can be closed.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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