转载请注明出处http://blog.csdn.net/wjlpld/article/details/41147457,谢谢~~~~
-------------------------------以下是开发常用代码-------------------------------
-------------------------------帧动画-------------------------------
Animation* animation = Animation::create(); for (int i=1;i<10;i++) { char szName[100] = {0}; sprintf(szName,"new/0%d.jpg",i); animation->addSpriteFrameWithFileName(szName); } animation->setDelayPerUnit(2.0f /24.0f); animation->setRestoreOriginalFrame(true); Animate* action = CCAnimate::create(animation); bg2->runAction(RepeatForever::create(action));
-------------------------------骨骼动画-------------------------------
ArmatureDataManager::getInstance()->addArmatureFileInfo("UI/start_show.ExportJson"); auto start_show = Armature::create( "start_show"); start_show->setPosition(Point::ZERO); start_show->setAnchorPoint(Point::ZERO); start_show->getAnimation()->play("normal"); this->addChild(start_show,1);
l-------------------------------Lamda表达式(用于Sequence)-------------------------------
CallFunc::create( [&](){ bossAct = MoveTo::create(tileShowTime,Point(Director::getInstance()->getVisibleSize().width/2,680)); bossEase = EaseBackInOut::create(bossAct); next->runAction(bossEase);})
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。