cocos2d-x CCAnimate 动画
来源:互联网 发布:vb 连接informix odbc 编辑:程序博客网 时间:2024/05/16 07:30
CCAnimation* animation = CCAnimation::create(); CCTexture2D* texture = CCTextureCache::sharedTextureCache()->addImage("play.png"); //play.png为一个拥有10帧的图片资源 int eachWidth = this->getContentSize().width/10; //每个帧的宽 for(int i = 0; i < 10; i++) { animation->addSpriteFrameWithTexture(texture, CCRectMake(i*eachWidth, 0, eachWidth, this->getContentSize().height)); } animation->setDelayPerUnit(0.5); //必须设置,否则不会动态播放 animation->setRestoreOriginalFrame(true); //是否回到第一帧 animation->setLoops(-1); //循环次数 -1无限循环 CCFiniteTimeAction* animate = CCAnimate::create(animation); this->runAction(animate);
this 代表CCSprite
- cocos2d-x CCAnimate 动画
- Cocos2d-x动画CCAnimate CCAnimation
- Cocos2d-x动画CCAnimate CCAnimation
- Cocos2d-x--CCAnimate实现简单动画
- cocos2d-x TestLua 之 CCAnimate
- 【Cocos2d-X开发学习笔记】第21期:动画类(CCAnimate)的使用
- Cocos2d学习之路三(使用Zwoptex创建精灵表单和CCAnimate动画)
- cocos2d-x动画工具
- cocos2d-x 动画
- Cocos2d-x切换动画
- Cocos2d-x 系统动画
- Cocos2d-x 自定义动画
- Cocos2d-x 帧动画
- Cocos2d-x 系统动画
- Cocos2d-x 自定义动画
- cocos2d-x帧动画
- Cocos2d-x-->CCSprite 动画
- cocos2d-x:动画 Animations
- ThinkPHP3.1新特性:多数据库操作…
- ThinkPHP3.1新特性:字段合法性检…
- 头文件 algorithm 中的常用函数
- windows cygwin sshd 服务启动失败解决方法 .
- main函数中的两个参数argc和argv
- cocos2d-x CCAnimate 动画
- 3.1的Widget有新玩法啦
- ThinkPHP3.1新特性:命名范围
- ThinkPHP3.1新特性:Action参数绑…
- ThinkPHP3.1 常量参考
- ThinkPHP3.1新特性: 多层MVC支持
- ThinkPHP3.1快速入门(10)缓存
- 模板引擎详解:导入资源文件
- 使用awk合并文件--生成report