博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
cocos2dx 3.1从零学习(六)——CocosStudio(VS2013project导入及环境设置)
阅读量:6856 次
发布时间:2019-06-26

本文共 1740 字,大约阅读时间需要 5 分钟。

导入libCocosStudio、libExtensions、libGUI

新建的project例如以下图:

加入现有项目

右键解决方式。例如以下操作:

分别加入下面三个项目:

(project路径)\cocos2d\cocos\ui\proj.win32\libGUI.vcxproj

(project路径)\cocos2d\cocos\editor-support\cocostudio\proj.win32\libCocosStudio.vcxproj

(project路径)\cocos2d\extensions\proj.win32\libExtensions.vcxproj

完毕后如图:

加入引用:

加入 附加包括文件夹。防止引入不了头文件:

须要有:

$(EngineRoot)cocos\editor-support

$(EngineRoot)cocos

$(EngineRoot)cocos\audio\include

$(EngineRoot)external

$(EngineRoot)external\chipmunk\include\chipmunk

$(EngineRoot)extensions
$(EngineRoot)

..\Classes

编译代码!

编译错误及解决方式:

1. 编辑器未更新

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets(64,5): error MSB8020: The build tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, please install Visual Studio 2010 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Upgrade Solution...".
在新加入的项目 右键更新VC++编译器。注意报这样的错的项目名称右边会有(VS2010***)的提示,就更新吧!

使用cocosstudio导出的project。

#include "cocos2d.h"#include "cocostudio/CocoStudio.h"#include "ui/CocosGUI.h"using namespace cocos2d;using namespace cocostudio;using namespace ui;

新手通过json文件读取控件的时候,注意它们的父子关系。不然会崩溃。

//载入CocosStudio导出的资源    auto uiLayer = GUIReader::getInstance()->widgetFromJsonFile("StartUI/StartUI.ExportJson");    this->addChild(uiLayer);    auto bg = uiLayer->getChildByName("bg");    auto button =(Button *) bg->getChildByName("button");    button->runAction(MoveBy::create(1, Point(-111, 0)));    button->addTouchEventListener(this, toucheventselector(CocosStudio::onButton) );
本文转自mfrbuaa博客园博客,原文链接:http://www.cnblogs.com/mfrbuaa/p/5074274.html,如需转载请自行联系原作者
你可能感兴趣的文章
Flask框架从入门到精通之路由(三)
查看>>
Istio 网关中的 Gateway 和 VirtualService 配置深度解析
查看>>
我的友情链接
查看>>
第九章 Linux系统下分区、格式化磁盘,学会挂载和卸载磁盘
查看>>
linux下IPTABLES配置详解
查看>>
Linux中硬盘转速查看
查看>>
未激活的windows server自动关机故障
查看>>
nginx实现大小写字母转换(ngx_http_lower_upper_case模块)
查看>>
Java并发编程实战(chapter_1)(原子性、可见性)
查看>>
C语言经典100例
查看>>
Varnish+Xcache构建高性能WEB构架初探
查看>>
Java程序中的内存漏洞
查看>>
Android安全模型之Android安全机制(应用程序签名)
查看>>
由于扩展配置问题而无法提供您请求的页面。如果该页面是脚本,请添加处理程序。如果应下载文件,请添加 M...
查看>>
什么是Web
查看>>
Oracle 健康监控器(Health Monitor)
查看>>
canvas-3文本&图片绘制与转换.
查看>>
centos5.5添加静态路由
查看>>
C/C++中获取数组的长度
查看>>
【windows】BIOS设置的中英文对照表
查看>>