1.加载动画
local node = cc.CSLoader:createNode("ActionTimeline/DemoPlayer_skeleton.csb")
local action = cc.CSLoader:createTimeline("ActionTimeline/DemoPlayer_skeleton.csb")
2.节点连接动画
node:runAction(action)
3.播放动画
1)roleAction:play(animationName, true) //动画的名字,是否循环
2)roleAction:gotoFrameAndPlay(0, true) //起始帧数,是否循环
3)roleAction:gotoFrameAndPlay(0, 10,true) //起始帧数,结束帧数,是否循环
4.动画帧事件监听
roleAction:setFrameEventCallFunc(function(frameEventName)
print(frameEventName:getEvent())
end)