Spine - Set animation time or frame number

Spine - Set animation time or frame number
0.0 0

#1

Hi,
I’m trying to start a spine animation at its half instead of its first frame.

So far I found nothing to help me do that.
I searched for “setFrame” or “setTime” without success.
I also tried to call that line once per frame to skip but it was no good ^^’

 mySpineAnim._sgNode.update() 

Any ideas?

Thanks :slight_smile:


#2

As I know, there isn’t any interface of Spine runtime for the requirement.
Maybe you should take a reference of the Official Spine documents.


#3

->setTimeScale();


#4

This sets the speeds as I understand it, but I’ll test if more nontheless.


#5

Hi,

spTrackEntry struct has variables animationStart, animationEnd and animationLast which you can change just after you set animation.

anim->setAnimation(0, "animation", true);
anim->getCurrent(0)->animationStart = anim->getCurrent(0)->animationEnd * 0.5;

also in some versions they are named time, endTime and lastTime.


#6

take it easy