cocos2dx lua:
local effect = cc.CSLoader:createNode("UI/Colour.csb")
effect:setPosition(self.rootWidget:getContentSize().width/2,self.rootWidget:getContentSize().height/2)
self.rootWidget:addChild(effect)
local action = cc.CSLoader:createTimeline("UI/Colour.csb")
effect:runAction(action)
action:gotoFrameAndPlay(0, true) --true循环播放,false 播放一次
cocos2dx c++:
auto root = CSLoader::createNode("Skeleton.csb");//填写你们动画文件的路径,这里是加载资源
root->setPosition(300,200);
this->addChild(root);
auto run = CSLoader::createTimeline("Skeleton.csb");//主要是这里还要加载一次动画;
root->runAction(run);//同一个文件创建的节点只能使用同一个文件创建的动画。
run->play("all", true);
local effect = cc.CSLoader:createNode("UI/Colour.csb")
effect:setPosition(self.rootWidget:getContentSize().width/2,self.rootWidget:getContentSize().height/2)
self.rootWidget:addChild(effect)
local action = cc.CSLoader:createTimeline("UI/Colour.csb")
effect:runAction(action)
action:gotoFrameAndPlay(0, true) --true循环播放,false 播放一次
cocos2dx c++:
auto root = CSLoader::createNode("Skeleton.csb");//填写你们动画文件的路径,这里是加载资源
root->setPosition(300,200);
this->addChild(root);
auto run = CSLoader::createTimeline("Skeleton.csb");//主要是这里还要加载一次动画;
root->runAction(run);//同一个文件创建的节点只能使用同一个文件创建的动画。
run->play("all", true);