cocos2d-x plist使用
windows下通过TexturePacker将单个的sprite放入
导出 niao.png 和 niao.plist
1 <?xml version="1.0" encoding="UTF-8"?> 2 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 3 <plist version="1.0"> 4 <dict> 5 <key>frames</key> 6 <dict> 7 <key>xiangsique_feixiang_001.png</key> 8 <dict> 9 <key>frame</key>10 <string>{{0,73},{47,73}}</string>11 <key>offset</key>12 <string>{2,0}</string>13 <key>rotated</key>14 <true/>15 <key>sourceColorRect</key>16 <string>{{4,0},{47,73}}</string>17 <key>sourceSize</key>18 <string>{51,73}</string>19 </dict>20 <key>xiangsique_feixiang_002.png</key>21 <dict>22 <key>frame</key>23 <string>{{0,0},{47,73}}</string>24 <key>offset</key>25 <string>{2,0}</string>26 <key>rotated</key>27 <false/>28 <key>sourceColorRect</key>29 <string>{{4,1},{47,73}}</string>30 <key>sourceSize</key>31 <string>{51,75}</string>32 </dict>33 </dict>34 <key>metadata</key>35 <dict>36 <key>format</key>37 <integer>2</integer>38 <key>realTextureFileName</key>39 <string>yingwu.png</string>40 <key>size</key>41 <string>{128,128}</string>42 <key>textureFileName</key>43 <string>yingwu.png</string>44 </dict>45 </dict>46 </plist>
将niao.png和niao.plist放入visual studio的 Resources目录下。
1 CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile("niao.plist");2 3 eagle_sprite_->initWithSpriteFrame(CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName("xiangsique_feixiang_001.png"));
在plist中只需要管sprite的<key>xiangsique_feixiang_001.png</key>
使用合成的png加plist的好处:目前使用的比较少没啥感觉,现在看来最明显的好处就是不让png文件很多很杂乱; 这个待补充。
好处:
1.Reduced OpenGL ES bind calls-the more images contained the textrue atlas, the greater the reduction.
2.Reduced memory footprint for the images stored as textrue in memory.
3.Easy method to trim and save on transparent apace in your images,allowing for more images/texture in the same apace.
4.Zwoptex and TexturePacker are fully supported by cocos2d, so creating and using texture atlases is painless.
write by fgd
转载于:https://www.cnblogs.com/wendao/archive/2011/12/13/egn_cocos2dx_plist.html
cocos2d-x plist使用相关推荐
- 在cocos2d-x中使用DragonBones实现骨骼动画
基础知识 要看懂本文,你需要了解骨骼动画(或称关节动画)是什么,以及DragonBones是什么.下面提供了一些资料: Skeletal Animation (Wikipedia en) Dragon ...
- cocos2d 使用TexturePacker制作plist文件
转自:https://blog.csdn.net/chiyiw/article/details/38170573 上一篇提到plist文件在cocos2d中的使用,那么如何制作plist文件呢? 一. ...
- Cocos2d使用TexturePacker工具打包生成plist和pvr.ccz文件方法总结
我们用TexturePacker工具打包生成了plist和pvr.ccz文件,那么下一步,我们就该获取plist中的信息了. Cocos2d中SpriteFrameCache通常用来处理plist文件 ...
- 【Cocos2d游戏开发之九】CCSpriteBatchNode与pvr.ccz,plist精灵优化及注意事项
前几节由于时间紧张,只是将一些遇到的问题拿出来进行分享经验,那么今天抽空写一篇常用的精灵以及精灵常用和注意的一些知识:那么由于cocos2d教程基本很完善,那么今天Himi介绍一些注意点和细节点分享大 ...
- CocosEditor-java加载图片出错cocos2d: fullPathForFilename: No file found at main.plist. Possible missing fi
错误如下: cocos2d: fullPathForFilename: No file found at /cc_2x2_white_image. Possible missing file. coc ...
- cocos2d 利用cocosStudio制作合图(plist与png)
- Improve Performance and Reduce Memory with PVRTC Textures and Cocos2d
转载自:http://www.uchidacoonga.com/2011/07/pvrtc-textures-and-cocos2d/ Hello everyone! A few months hav ...
- 如何优化cocos2d程序的内存使用和程序大小:第一部分
译者: 在我完成第一个游戏项目的时候,我深切地意识到"使用cocos2d来制作游戏的开发者们,他们大多会被cocos2d的内存问题所困扰".而我刚开始接触cocos2d的时候,社区 ...
- [cocos2d-x]cocos2d和cocos2d-x的一些通用性
不得不说要说总结,因为Cocos2d-X的代码和Cocos2d-iphone两个引擎除了语言不同外(Cocos2d-X使用C++,Cocos2d-iphone使用Object-C)可以说没有其他差异. ...
- cocos2d+lua实现帧动画播放
使用Cocos2d播放帧动画的方法有两种: 先来介绍一下流程: 1.得到动画的每一帧的数组FrameArray 2.将帧动画数组包装成Animation对象 3.将Animation对象转化为可以播放 ...
最新文章
- Python学习笔记__13.2章 requests
- grafana 监控mysql_Prometheus+Grafana监控MySQL性能
- 通过cordova将vue项目打包
- Python基础入门:endswith() 函数
- ubuntu下查询SSH状态和安装SSH服务
- why quantity change in item can cause CUMULAT_H changed as well
- java趣事_【趣事】Java程序员最年轻,C++程序员最年老
- AJHG | 人类遗传学领域一流期刊推荐
- php爬虫伪造请求头,Nodejs 伪造IP 爬取图片
- 判断Windows服务是否启动
- Java基础,双色球系统实现,完整版本,没有BUG,完整代码版
- vs2019键盘钩子_低级键盘钩子回调函数
- JavaWeb实现视频在线播放
- oracle注射,中国联通沃支付一处Oracle数据库注射
- 程序人生之常见术语与名词解释
- C6678之外部存储器接口EMIF
- 什么是软件的生命周期?
- unbalanced calls to begin/end appearance transitions for uiviewcontroller的解决方法
- 【梁小国】教你怎么签自己的名字
- 中值滤波matlab