A version with applying animation directly seems working. Thank you very much for your help!
agentprog

- 12 mag 2014
- Si è iscritto 2 mag 2014
Thank you for your reply!
I have come up with a solution based on the AnimationStateListener and setting the time field of the TrackEntry:
void animationStateListener(spAnimationState* state, int trackIndex, spEventType type, spEvent *event, int loopCount) { if (type == SP_ANIMATION_COMPLETE) { spTrackEntry *entry = spAnimationState_getCurrent(state, trackIndex); if (entry) { entry->time = 8.0f / 30; } } }
Is it a normal solution or there are better ways to achieve that? And is 30 some kind of standard FPS for spine animations?
Also it causes some flickering between loops. It still updates to the initial pose first and after that to the 8th frame after i set it in listener.
- Modificato
Hello!
Some of the looping animations we have created in Spine have some kind of "prologue" and looping part starts with an offset. In Spine i can set Loop Start and Loop End parameters to make an animation looping correctly. But when i started to work with runtimes, C runtime specifically, i couldn't find equivalents of such parameters. Of course, we can move the prologue part into a separate animation, but if there is some way to set Loop Start and Loop End parameters in code, i'd prefer that solution.
Anyway, Spine is awesome