mirror of https://github.com/axmolengine/axmol.git
update csloader
This commit is contained in:
parent
9fdd8cee06
commit
41c86de0d4
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue