2
\$\begingroup\$

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.

\$\endgroup\$

2 Answers 2

0
\$\begingroup\$

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.

\$\endgroup\$
0
\$\begingroup\$

You can play an animation and :

animation->setDelayPerUnit(T);
\$\endgroup\$
1
  • \$\begingroup\$ This appears to allow you to slow the animation down arbitrarily, but not necessarily to manually play it frame-by-frame? \$\endgroup\$
    – user1430
    Dec 5, 2014 at 17:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .