Closed iaincarsberg closed 12 years ago
There's a method called resetAnimationTime(). Could you give it a try and let me know whether this fixes it ?
That call has been added to setAnimationImageIndex. Could you try with a fresh CAAT version instead the previous ?
This bug still exists in caat.js Version: 0.4 build: 278.
Patch:
13704c13704
> this.spriteIndex=this.animationImageIndex[0];
...the bug is very annoying when animating a spriteImage that was initialized with a map created by the online tile tool, because the 0th frame then is the whole packed texture with all sprites! ;)
So - the patch posted above fixes the issue.
Cheers, Phloog
Fixed. Thank you.
ghthor, thanks for sending the patch. Will be fixed in the next revision, this week.
Hey, hyperandroid
I've found a bug, and a solution, not sure which file to edit to submit a patch, but if you look at...
https://github.com/hyperandroid/CAAT/blob/master/build/caat.js#L13320
Imho this should be: this.spriteIndex = this.animationImageIndex[0];
Use case for the bug Your using a sprite sheet for your animations, thats set using ".setAnimationImageIndex([0, 1, 2, 3])", then after a period of time you want to switch to another animation index, via ".setAnimationImageIndex([4, 5, 6, 7])", currently for a few ms its switching to the 0th frame, before entering the frame at index 4.
Thanks Iain