This is only theory. Eventually I will do a test to see if this is viable. Meanwhile, experience of other users of the engine is very welcome.
The theory: as actions doesn’t have a pause/resume interface, one way of achieve this if you ever need such functionality, may be:
track the time elapsed since an action was ran, or get the time elapsed using action’s interface (ActionInterval::getElapsed() looks promising). Then, when resuming, create a new action with exact the same configuration and call new_action->step(prev_action_elapsed).
Or maintain a reference to a running action, through a RefPtr, so when you call some_node->stopAction you can re run the action from where it was interrupted before (I’m about to test if actions remember its elapsed time after stopped, or if they rewind).
@bilalmirza, it was easier than I thought then. Thank you.
@slackmoehrle, that would be welcome. For the most part documentation is good, api ref is complete. The functions names are actually self explanatory (pause/resume), I just missed them this time.
I’m in a situation where if a condition is met, a moving sprite must stop, and resume its movement at a later time. I’m also using a not linear interpolation, it’s important action state doesn’t reset, I don’t want the sprite to start slow again. That must be desirable for most situations but not for this case. It must look like time stopped then resumed. Maybe I can post an animated gif but I think is not required as the question is answered.
off-topic: I visited some questions on stackoverflow about cocos2d and came with the idea that actions weren’t pausable. May that be the case for some old releases?