更换图片
2015-10-29 18:31
232 查看
CCSpriteBatchNode *spriteBatch=CCSpriteBatchNode::batchNodeWithFile("********.png");
this->addChild(spriteBatch);
//加载plist
CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile("myconfig.plist");
// 生成Sprite
CCSprite *headSprite=CCSprite::spriteWithSpriteFrameName("aaa.png");
//需要更换图片时
CCSpriteFrame *frame=CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName("bbb.png");
headSprite->setDisplayFrame(frame);
this->addChild(spriteBatch);
//加载plist
CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile("myconfig.plist");
// 生成Sprite
CCSprite *headSprite=CCSprite::spriteWithSpriteFrameName("aaa.png");
//需要更换图片时
CCSpriteFrame *frame=CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName("bbb.png");
headSprite->setDisplayFrame(frame);
相关文章推荐
- PLSQL Developer使用技巧整理
- eclipse使用介绍
- HDU 1532 Drainage Ditches(Dinic)
- OpenJudge1551 Sumsets
- Requests高级用法
- Make 命令教程
- 怎么导入vitamio并能在自己的程序中使用
- outline属性的设置和作用简述
- 控制器跳转
- 设计模式 -- 工厂模式(Factory)
- Angular.js学习笔记(四)
- 1、SQL可搜索可排序可分页存储过程, 2、范围内的随机时间 适用于sql 2008以上
- 设计模式 -- 工厂模式(Factory)
- Spring Boot 学习第二步 配置MySQL数据库+JPA
- Android5.0系统:Material风格以及DrawerLayout抽屉效果
- 正则表达式筛选数据 表达式语法 自己总结的
- Oracle 修改http端口
- 内存溢出和内存泄露的区别
- ulimit详解
- Leetcode -- Course Schedule