How to control the animation play to a specified time at once?


#1

For example, I have a animation named ‘run’, and it lasts for 1 second, I want to control node to play the ‘run’ animation to 0.5 second.
This is my code section:

m_pCCBAnimationMgr->runAnimationsForSequenceNamedTweenDuration(“run”,0);
CCDirector::sharedDirector()->getScheduler()->update(0.5);
CCDirector::sharedDirector()->pause();

But it doesn’t work, the node dosen’t play animation to the time.


#2

I need this for the editor, so I can control the animation playing by the slider