温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

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

发布时间:2020-03-12 13:48:05 来源:网络 阅读:551 作者:googlingman 栏目:游戏开发

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


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

 

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI