首页 > 其他 > 详细

拇指接龙游戏升级记录01(CocoStudio 1.4.0.1+Cocos2d-x 2.2.3=>Cocos Studio 2.3.2+Cocos2d-x 3.8.1)

时间:2015-10-26 10:32:30      阅读:372      评论:0      收藏:0      [点我收藏+]

近段时间将努力把课程《拇指接龙游戏》更新到目前最新版本。本小系列将记录下更新过程中遇到的各种问题,作为备忘,同志者可参考之。因时间等原因,有些内容暂不作深入剖析。


UILayer和TouchGroup=>Layer。

另外,在原先版本DEMO中很多情况下可以省略Layer,见下面代码:

 

原先游戏中有这样的代码:

void SplashScreen::runThisScene()
{
 CCDirector::sharedDirector()->runWithScene(this);
 ul = UILayer::create();
 ul->scheduleUpdate();
 this->addChild(ul);
 /////////////////////////////////////////////////
 //内部的plist文件引用使用的是相对地址,即当前位置,不需要添加路径//
 UILayout* rootPanel=dynamic_cast<UILayout*>(GUIReader::shareReader()->widgetFromJsonFile("publish/SplashUI.ExportJson"));
 ul->addWidget(rootPanel);
/...

如今可以这样:

 

void SplashScreen::runThisScene()
{
 Director::getInstance()->runWithScene(this);
 /////////////////////////////////////////////////
  Node *pNode = GUIReader::getInstance()->widgetFromJsonFile("publish/SplashUI.ExportJson");
 this->addChild(pNode);
 /...

 

 

 


 

 

 


REFs:

 

  1. http://segmentfault.com/a/1190000000593010

 

本文出自 “青峰” 博客,请务必保留此出处http://zhuxianzhong.blog.51cto.com/157061/1706181

拇指接龙游戏升级记录01(CocoStudio 1.4.0.1+Cocos2d-x 2.2.3=>Cocos Studio 2.3.2+Cocos2d-x 3.8.1)

原文:http://zhuxianzhong.blog.51cto.com/157061/1706181

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!