帧动画和旋转
来源:互联网 发布:mysql如何查看 编辑:程序博客网 时间:2024/05/22 00:43
CCSprite* pSprite = CCSprite::create("scene15_pig01_01.png");pSprite->setPosition(ccp(400,200));
this->addChild(pSprite, 0,3);
CCAnimation *animation = CCAnimation::create();
animation->addSpriteFrameWithFileName("1.png");
animation->addSpriteFrameWithFileName("2.png");
animation->addSpriteFrameWithFileName("3.png");
animation->setDelayPerUnit(2.8f / 14.0f);// This animation contains 14 frames, will continuous 2.8 seconds.
animation->setRestoreOriginalFrame(true);// Return to the 1st frame after the 14th frame is played.
CCAnimate *action = CCAnimate::create(animation);
CCRepeatForever* mFly=CCRepeatForever::actionWithAction( CCAnimate::actionWithAnimation(animation));
pSprite->runAction(mFly);
CCLOG("add MCCSprite");
CCSprite* sprite = MCCSprite::create("scene11_windmill_yy.png");
sprite->setPosition(ccp(700, 500));
this->addChild(sprite, 0);
CCRotateBy* rotate = CCRotateBy::actionWithDuration(1, 360);
CCRepeatForever* repeatRotate = CCRepeatForever::actionWithAction(rotate);
sprite->runAction(repeatRotate);
this->addChild(pSprite, 0,3);
CCAnimation *animation = CCAnimation::create();
animation->addSpriteFrameWithFileName("1.png");
animation->addSpriteFrameWithFileName("2.png");
animation->addSpriteFrameWithFileName("3.png");
animation->setDelayPerUnit(2.8f / 14.0f);// This animation contains 14 frames, will continuous 2.8 seconds.
animation->setRestoreOriginalFrame(true);// Return to the 1st frame after the 14th frame is played.
CCAnimate *action = CCAnimate::create(animation);
CCRepeatForever* mFly=CCRepeatForever::actionWithAction( CCAnimate::actionWithAnimation(animation));
pSprite->runAction(mFly);
CCLOG("add MCCSprite");
CCSprite* sprite = MCCSprite::create("scene11_windmill_yy.png");
sprite->setPosition(ccp(700, 500));
this->addChild(sprite, 0);
CCRotateBy* rotate = CCRotateBy::actionWithDuration(1, 360);
CCRepeatForever* repeatRotate = CCRepeatForever::actionWithAction(rotate);
sprite->runAction(repeatRotate);
- 帧动画和旋转
- 使用旋转动画和帧动画实现自定义ProgressDialog
- Android 旋转动画,停止和持续旋转
- 单帧旋转动画
- Android加载动画 旋转动画 、帧动画
- android动画1-平移和旋转
- 旋转动画
- 旋转动画
- 动画旋转
- 旋转动画
- 旋转动画
- 旋转动画
- 旋转动画
- 旋转动画
- 旋转动画
- 旋转动画
- 动画之旋转动画
- Android单帧动画Rotate旋转
- C++学习之旅——结构体和联合体的区别,以及数据对齐方式影响内存大小
- red hat 企业版更新源的添加
- 解读Python内存管理机制
- c++词法分析器
- Foreign Language_english_限定词
- 帧动画和旋转
- COJ 1373 STL中的map每日四水
- A star 寻路算法实现(C++版本)
- 【PAT Advanced Level】1006. Sign In and Sign Out (25)
- hashCode和equals方法的理解
- 编写一个字符串复制函数mystrcopy(char*s1,char*s2,int m),将字符串s2中从第m个开始全部字符都复制到s1中
- hdu4762之大数乘法
- uva 10562
- Trystack中文网为您提供最后一次优惠机会(门票七五折)