update csloader

This commit is contained in:
youyou 2014-12-09 22:13:17 +08:00
parent 9fdd8cee06
commit 41c86de0d4
1 changed files with 27 additions and 0 deletions

View File

@ -29,6 +29,7 @@
#include "../../cocos/ui/CocosGUI.h"
#include "CCActionTimelineCache.h"
#include "CCActionTimeline.h"
#include "CCActionTimelineNode.h"
#include "../CCSGUIReader.h"
#include "cocostudio/CocoStudio.h"
#include "cocostudio/CSParseBinary_generated.h"
@ -280,6 +281,32 @@ ActionTimeline* CSLoader::createTimeline(const std::string &filename)
return nullptr;
}
ActionTimelineNode* CSLoader::createActionTimelineNode(const std::string& filename)
{
Node* root = createNode(filename);
ActionTimeline* action = createTimeline(filename);
if(root && action)
{
root->runAction(action);
action->gotoFrameAndPlay(0);
}
ActionTimelineNode* node = ActionTimelineNode::create(root, action);
return node;
}
ActionTimelineNode* CSLoader::createActionTimelineNode(const std::string& filename, int startIndex, int endIndex, bool loop)
{
ActionTimelineNode* node = createActionTimelineNode(filename);
ActionTimeline* action = node->getActionTimeline();
if(action)
action->gotoFrameAndPlay(startIndex, endIndex, loop);
return node;
}
Node* CSLoader::createNodeFromJson(const std::string& filename)
{
if (_recordJsonPath)