Spine uses 30 fps. It isn't configurable yet.
It flickers because complete is called after the animation loops. AnimationState
has already posed the skeleton using the beginning of the animation. You could fix this by doing entry->time += 8.0f / 30;
, which will preserve the amount of time that went past the end of the animation, then you need to pose the skeleton at this time. One way to do that could be to call spAnimationState_apply
again, but that might cause issues with AnimationState
's internal state. You could also just apply the animation:
int eventCount;
spAnimation_apply(entry->animation, skeleton, entry->lastTime, entry->time, 0, 0, &eventCount);
This passes 0 for events, so no events will be fired. Since the AnimationState
already applied at the beginning of the animation, it could have fired events from the beginning of the animation which might be unexpected.
Another way to do it is either edit AnimationState
or before calling spAnimationState_apply
see if the delta would cause the TrackEntry
to loop and adjust the time before AnimationState
applies the animation.