windows下通过TexturePacker将单个的sprite放入

  导出 niao.png        和         niao.plist

View Code

 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使用相关推荐

  1. 在cocos2d-x中使用DragonBones实现骨骼动画

    基础知识 要看懂本文,你需要了解骨骼动画(或称关节动画)是什么,以及DragonBones是什么.下面提供了一些资料: Skeletal Animation (Wikipedia en) Dragon ...

  2. cocos2d 使用TexturePacker制作plist文件

    转自:https://blog.csdn.net/chiyiw/article/details/38170573 上一篇提到plist文件在cocos2d中的使用,那么如何制作plist文件呢? 一. ...

  3. Cocos2d使用TexturePacker工具打包生成plist和pvr.ccz文件方法总结

    我们用TexturePacker工具打包生成了plist和pvr.ccz文件,那么下一步,我们就该获取plist中的信息了. Cocos2d中SpriteFrameCache通常用来处理plist文件 ...

  4. 【Cocos2d游戏开发之九】CCSpriteBatchNode与pvr.ccz,plist精灵优化及注意事项

    前几节由于时间紧张,只是将一些遇到的问题拿出来进行分享经验,那么今天抽空写一篇常用的精灵以及精灵常用和注意的一些知识:那么由于cocos2d教程基本很完善,那么今天Himi介绍一些注意点和细节点分享大 ...

  5. 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 ...

  6. cocos2d 利用cocosStudio制作合图(plist与png)

  7. 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 ...

  8. 如何优化cocos2d程序的内存使用和程序大小:第一部分

    译者: 在我完成第一个游戏项目的时候,我深切地意识到"使用cocos2d来制作游戏的开发者们,他们大多会被cocos2d的内存问题所困扰".而我刚开始接触cocos2d的时候,社区 ...

  9. [cocos2d-x]cocos2d和cocos2d-x的一些通用性

    不得不说要说总结,因为Cocos2d-X的代码和Cocos2d-iphone两个引擎除了语言不同外(Cocos2d-X使用C++,Cocos2d-iphone使用Object-C)可以说没有其他差异. ...

  10. cocos2d+lua实现帧动画播放

    使用Cocos2d播放帧动画的方法有两种: 先来介绍一下流程: 1.得到动画的每一帧的数组FrameArray 2.将帧动画数组包装成Animation对象 3.将Animation对象转化为可以播放 ...

最新文章

  1. Python学习笔记__13.2章 requests
  2. grafana 监控mysql_Prometheus+Grafana监控MySQL性能
  3. 通过cordova将vue项目打包
  4. Python基础入门:endswith() 函数
  5. ubuntu下查询SSH状态和安装SSH服务
  6. why quantity change in item can cause CUMULAT_H changed as well
  7. java趣事_【趣事】Java程序员最年轻,C++程序员最年老
  8. AJHG | 人类遗传学领域一流期刊推荐
  9. php爬虫伪造请求头,Nodejs 伪造IP 爬取图片
  10. 判断Windows服务是否启动
  11. Java基础,双色球系统实现,完整版本,没有BUG,完整代码版
  12. vs2019键盘钩子_低级键盘钩子回调函数
  13. JavaWeb实现视频在线播放
  14. oracle注射,中国联通沃支付一处Oracle数据库注射
  15. 程序人生之常见术语与名词解释
  16. C6678之外部存储器接口EMIF
  17. 什么是软件的生命周期?
  18. unbalanced calls to begin/end appearance transitions for uiviewcontroller的解决方法
  19. 【梁小国】教你怎么签自己的名字
  20. 中值滤波matlab

热门文章

  1. 201521123031 《Java程序设计》第6周学习总结
  2. .NET Framework 各版本区别
  3. ASP.NET MVC:@helper 不能调试
  4. 超完整的用户体验设计流程,规范化提升产品效率
  5. 【人物】Paul Graham: 卑鄙的人一定失败
  6. 递归系列之一_南诺塔问题
  7. 移动端图片上传方法【更好的兼容安卓IOS和微信】
  8. 迁移到云端,千万别犯这3个大错误!
  9. Android 的全盘加密容易破解
  10. Unity3dShader_边缘发光效果