Andy R Posted August 4, 2017 Share Posted August 4, 2017 Hi, i'm facing a issue animating a char with spritesheet. I'm trying to animate a character with up/left/down/right animation. I'm using this one : https://opengameart.org/content/cowboy-platform-and-isometric-sprite-sheet Here's my code : https://pastebin.com/2EF6CEk5 Left and right moves work well, the error appears when using "up" moves, the character does not start animating with the good frame (i want it to start with first column 6 rows), instead it starts with 7 cols 6 rows ). Maybe i dont understand how case numbers work xith multiples rows spritesheets. By the way, i'm very new to Phaser, i'm up to hear advices if there's a better way to do this. Here's the first frame of up move. Thanks Link to comment Share on other sites More sharing options...
rich Posted August 8, 2017 Share Posted August 8, 2017 The issue is that you said that sprite sheet frames are 129 x 129 pixels, but the sprite sheet itself does not fit evenly into these dimensions. It has a width of 1792 which / 129 = 13.8914, so when Phaser tries to chop the frames up based on the image width it can't do it evenly, so the frame IDs are all out of sync. I'd recommend fixing the sprite sheet so it evenly divides by 129. Link to comment Share on other sites More sharing options...
Andy R Posted August 8, 2017 Author Share Posted August 8, 2017 Thank you for your answer, by time I found another way to have it done using TexturePacker. I'll continue with that, it gives more control about how frame to use. Nice framework btw ! ;-) Link to comment Share on other sites More sharing options...
Recommended Posts