cocos lua 中, 动画文件让其调到指定的帧数

 local function  aniBack(frame)
         -- body
        if(frame == nil) then  return end;

         local event = frame:getEvent();



         release_print(tostring( event ));
         
       end

        local node  = self.map:getChildByName("node_tree");
       
        --local node = cc.CSLoader:createNode("Node.csb");
    --wait()
       release_print("iiiiiiiii !!!");
        
        local action = cc.CSLoader:createTimeline("Node.csb");
        node:runAction(action)
        action:setTimeSpeed(-1)
        release_print("iiiiiiiii !!!");
        action:gotoFrameAndPlay(action:getEndFrame(), false)
        
        

        action:setFrameEventCallFunc(aniBack);


这里需要谨记的时候, 需要将 setTimeSpeed的参数设置为-1, 不然它还是会有播放效果的




猜你喜欢

转载自blog.csdn.net/u014660247/article/details/71405070