首页 > 其他 > 详细

cocos3 帧动画无限重复

时间:2014-12-28 09:13:28      阅读:238      评论:0      收藏:0      [点我收藏+]
    auto animation = Animation::create(); 
    animation->addSpriteFrameWithFile("NPC/hero.png");
    animation->addSpriteFrameWithFile("NPC/hero1.png");
  
    // should last 2.8 seconds. And there are 14 frames. 
    animation->setDelayPerUnit(2.8f / 14.0f); 
    animation->setRestoreOriginalFrame(true); 
    auto action = Animate::create(animation);
    auto repeat=RepeatForever::create(action);
    auto creep=RepeatForever::create(action);
    runAction(creep); 

 

cocos3 帧动画无限重复

原文:http://www.cnblogs.com/yufenghou/p/4189593.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!