SpriteBatchNode与SpriteFrameCache加快渲染
来源:互联网 发布:python安装程序下载 编辑:程序博客网 时间:2024/06/05 00:26
一、SpriteBatchNode
<pre name="code" class="cpp">SpriteFrameCache::getInstance()->addSpriteFramesWithFile("test.plist","test.png"); Node* node = Node::create(); char name[32]; for(int i = 0;i<100;++i) { char name[15]; memset(name, 0, sizeof(name)); //auto sprite = Sprite::create(name); auto sprite = Sprite::createWithSpriteFrameName(name); sprite->setPosition(Point(i*5,i*5)); node->addChild(sprite, 0); } this->addChild(node);
二、SpriteFrameCache
首先我们使用合图软件,将这10张图合成一张大图和一个plist文件。在使用CocoStudio导出时,选择“使用大图”即可将小图合成一张大图。当然我们也可以选择TexturePacker这种专业的合图软件,合成的图片分为“test.png”和“test.plist”两部分,然后使用SpriteFrameCache。
SpriteFrameCache::getInstance()->addSpriteFramesWithFile("test.plist","test.png"); Node* node = Node::create(); char name[32]; for(int i = 0;i<100;++i) { char name[15]; memset(name, 0, sizeof(name)); //auto sprite = Sprite::create(name); auto sprite = Sprite::createWithSpriteFrameName(name); sprite->setPosition(Point(i*5,i*5)); node->addChild(sprite, 0); } this->addChild(node);
0 0
- -SpriteBatchNode与SpriteFrameCache加快渲染
- SpriteBatchNode与SpriteFrameCache加快渲染
- SpriteBatchNode与SpriteFrameCache加快渲染
- cocos2dx-3.0(14)------SpriteBatchNode与SpriteFrameCache加快渲染
- cocos2dx-3.0(13)------SpriteBatchNode与SpriteFrameCache加快渲染
- cocos2dx-3.0(13)------SpriteBatchNode与SpriteFrameCache加快渲染
- cocos2dx-3.0(13)------SpriteBatchNode与SpriteFrameCache加快渲染
- cocos2d-SpriteBatchNode与SpriteFrameCache加快渲染的优缺点
- Cocos2d-x-3.10 SpriteBatchNode渲染
- SpriteBatchNode
- SpriteFrameCache
- highCharts加快渲染速度
- nw渲染加快
- nw渲染加快
- 【cocos2d-x3.5】Lua Plist与SpriteFrameCache
- 加快easyui的datagrid的数据渲染
- 使用DocumentFragment加快DOM渲染速度
- cocos2dx v3.9 与SpriteFrameCache和AnimationCache之间的对话
- 前妻贾斯汀解读马斯克何以能“极度成功”:痴迷!痴迷!痴迷!
- 语音上传,播放
- 用Js的eval解析JSON中的注意点
- I2S总线协议简介
- NSDP协议免费版NAC-v1.0发布
- SpriteBatchNode与SpriteFrameCache加快渲染
- 全选反选、登陆、ajax删除等等 思路以及伪代码
- 撰写架构设计文档的心得体会
- android进程调试(ro.debuggable=1或android:debuggable="true")---->JDWP线程
- phpRedisAdmin Redis_web界面管理工具
- 新建文件快速生成Html头部信息和炫酷的代码补全
- php实现AJAX长轮询
- ERROR 1146 (42S02): Table 'mysql.slow_log' doesn't exist
- I2C总结