Cocos2d-x游戏开发之TecturePacker的plist解析-创新互联

先要做准备工作

创新互联公司成立于2013年,我们提供高端重庆网站建设成都网站制作公司成都网站设计公司、网站定制、成都营销网站建设小程序制作、微信公众号开发、seo优化服务,提供专业营销思路、内容策划、视觉设计、程序开发来完成项目落地,为成都围栏护栏企业提供源源不断的流量和订单咨询。

先下载DS_Dictionary.h和Ds_Dictionary.cpp,不多说提供下载地址

http://www.cocos2d-x.org/boards/6/topics/6125?r=13203#message-13203

文件基于pugixml下面是下载地址

http://pugixml.org/

下面提供test.plist作对照

  1. >

下面提供一个解析的函数

  1. void
  2. //Load rootDict from file, and then step into the metadata sub dict.
  3. if
  4. "no load\n"
  5. if"texture"
  6. "No texture\n"
  7. //Get an int value from the subdict
  8. int"height"
  9. "height    %d\n"
  10. "width"
  11. "width    %d\n"
  12. //Step out of the sub dict and into another
  13. if"frames"
  14. "no dic\n"
  15. forint
  16. char
  17. "bg_%d.png"
  18. if
  19. //printf("No    %s\n",picture);
  20. continue
  21. int"x"
  22. int"y"
  23. int"width"
  24. int"height"
  25. void

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


分享文章:Cocos2d-x游戏开发之TecturePacker的plist解析-创新互联
标题URL:http://myzitong.com/article/dgiged.html