Cocos2dx 3.1 learning from scratch (6) -- cocosstudio (vs2013 project import and environment settings)

Source: Internet
Author: User
Tags visual studio 2010
Import libcocosstudio, libextensions, and libgui

The newly created project is as follows:


Add existing project

Right-click the solution and perform the following operations:


Add the following three projects:

(Project path) \ cocos2d \ Cocos \ UI \ proj. Win32 \ libgui. vcxproj

(Project path) \ cocos2d \ Cocos \ Editor-support \ cocostudio \ proj. Win32 \ libcocosstudio. vcxproj

(Project path) \ cocos2d \ extensions \ proj. Win32 \ libextensions. vcxproj

After completion



Add reference:





Add an additional include directory to prevent header files from being introduced:


You need:

$ (Engineroot) Cocos \ Editor-support
$ (Engineroot) cocos
$ (Engineroot) Cocos \ audio \ include
$ (Engineroot) External
$ (Engineroot) external \ chipmunk \ include \ chipmunk
$ (Engineroot) Extensions
.. \ Classes


Compile the code!

Compilation errors and solutions:

1. The editor is not updated.

C: \ Program Files (x86) \ msbuild \ Microsoft. CPP \ v4.0 \ v120 \ microsoft.cpp.platform.tar gets (2010): Error msb8020: The build tools for Visual Studio (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... ".
Right-click the newly added project to update the VC ++ compiler. Note that there will be a (vs2010 ***) Prompt on the right side of the project name that reports this error. update it!

Project exported using cocosstudio.

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


When a newbie reads controls through a JSON file, pay attention to their parent-child relationship, or else it will crash.

// Load the resource 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 ));

Compilation error and solution: Using namespace UI; if an error is reported, add using namespace cocos2d to the front.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.