As I know animations are actions. Now I need to play animation frame by frame. Say I have an animation from N frames. each frame should be played after t delay. Now I want to play animation frame by frame, each frame advance the animation's state. How I can do this?

And what about playing actions frame by frame advancing the state in general.

I ask because I use ECS, and I deal with frames.

P.S. I want to do something like this:

Action * a = MoveTo(initialPoint, finalPoint, durationOfAnimation);

a->play(0.001 seconds);
a->play(0.003 seconds);
a->play(0.02 seconds);
a->play(0.67 seconds);
a->play(0.06 seconds);

And see the animation.

I think you can call a->update(0.001) - see the doc of Action's update : http://www.cocos2d-x.org/reference/native-cpp/V3.0/db/d61/classcocos2d_1_1_action.html#ac8cae2d59252ed4c924a6c0ec86527db

So instead running the action automatically call the update yourself.

You can play an animation and :

animation->setDelayPerUnit(T);
  • This appears to allow you to slow the animation down arbitrarily, but not necessarily to manually play it frame-by-frame? – Josh Dec 5 '14 at 17:13

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.