cocos2d/cocos2d-x — pull request #7054 by 2youyouo2 (2014-06-12 12:02:05+00:00)
Title: add TimelineAction

TimelineAction is used for decode exported data from CocoStudio mac version.
It's a better solution for Armature.

TimelineAction inherits from cocos2d:;Action, so it's more closed to cocos2d.
TimelineAction's struct is more flexible and clear than Armature.
Frame -> Timeline -> TimelineAction
Frame is easy to extend its type, you just need to inherit from Frame, and implement Frame::onEnter, Frame::apply.

TimelineActionCache will load data from json resource and cache it.
When creates a new TimelineAction, TimelineActionCache will clone one from cache.

NodeReader will create a node tree from json resourece.

To run a TimelineAction, you need to do like this:

Node* node = NodeReader::getInstance()->createNode("TimelineAction/boy_1.ExportJson");
TimelineAction* action = TimelineActionCache::getInstance()->createAction("TimelineAction/boy_1.ExportJson");

node->runAction(action);
action->gotoFrameAndPlay(0, 60, true);