"Independent Developer ER cocos2d-x combat 001" CSB file Export and load

Source: Internet
Author: User

to export a resource file using Cocos Studio:
then load the CSB file in the Cocos project:Auto Mylayout = Csloader::createnode ("/RES/DESKTOP/LAYER.CSB");AddChild (mylayout);
runtime encounters a problem-Cocos studio Edit and Cocos2dx run inconsistently:

The above problem is because the EXE file cannot find the resources, and later found that we need to copy the relevant resources to the resource directory,the solution to the white font at the same time is to add images to the click events of the pictures in Cocos Studio. because Visual Studio, at run time, copy all of the resources in the corresponding project project path to the run path.

But then after I moved to the button, I found that the button position was inconsistent with the edit and Cocos2dx runs, and that the preview effect in the Edit and Cocos Studio was not consistent.
(There is a red button in the Visualization pane in Cocos Studio, but the Cocos Studio run button is missing): This is because of a path problem. let's start by understanding the paths that exist today:Cocos Studio Preview path: D:\CocosStudio\Cocos\cocos-simulator-bin\win32Cocos Studio Run path: D:\CocosStudio\Documents\Cocos\CocosProjects\mybtntest\bin\debug\win32Cocos Studio release path: d:/cocos2d/cocos2d-x-3.6/projects/hello/resources/res/Visual Studio Run path: D:\COCOS2D\cocos2d-x-3.6\projects\hello\proj.win32\Debug.win32.
What we need to be aware of is the Cocos Studio run path and the Visual Studio run path . Because they need to use the resources we publish when they are running. For the above preview and runThe inconsistency is due to running in Cocos Studio, as we publish the resources to d:/cocos2d/cocos2d-x-3.6/projects/hello/resources/res/,As a result, Cocos Studio cannot find resources when it loads resources, resulting in inconsistencies. We just have to d:/cocos2d/cocos2d-x-3.6/projects/hello/resources/res/ theThe associated resources are copied to the appropriate resource directory for the Cocos Studio run path: D:\CocosStudio\Documents\Cocos\CocosProjects\mybtntest\Resources\res. because either Cocos Studio or Visual Studio, at run time, all resources under the resource in the corresponding project project path are copied to the run path.

Other: CSD is a modifiable Ccstudio engineering file, and CSB is an exported resource file.
Reference Blog:http://blog.csdn.net/chinahaerbin/article/details/17339877

"Independent Developer ER cocos2d-x combat 001" CSB file Export and load

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.