Cocos2d-x Create groups for any added folders and Create folde

Source: Internet
Author: User

 

 

We want to add a file to the Cocos2d-x directory in either of the following ways:

First, right-click in the navigation bar and choose Add files

 

Second, drag the file directly.

 

However, either way, we will face one option, namely the Folders option:

As shown in, there are two options for Folders:

Create groups for any added folders

Create folder references for any added folders

If you select the first method to add a file, we will find the added file, the folder is yellow

The second method is selected. The folder of the file to be added is blue.

What are the differences between the two methods?

 

1. use Create groups for any added folders to Create a group for any newly added folder. The group concept may be unfamiliar to us, you can manually add a Group in the project (right-click and select New Group), but the Group you manually add does not actually exist in the project directory, you will find that the file added to the groups is still in its original location, but the groups introduced from the outside will not, as we did just now. Once a groups object is created or added, it is in the form of a yellow folder. When you want to use the header file of a class in the folder, you can directly add its reference, for example

# Include xxx. h

This is because the cpp file under groups will be compiled.

 

2. using the Create folder references for any added folders method only creates a reference to the file, and these files are not compiled. Therefore, you need to add the path when using the file, for example, if we want to use a header file under the myScripts folder, we need to add the declaration as follows:

# Include myScripts/xxx. h

Otherwise, the compiler will tell you that the xxx. h file cannot be found.

 

This is the difference between the yellow folder and the blue folder in the project and how to use it.

 

As for the Destination option, if you select this option, if the file you want to introduce is not in the directory of your project file, xcode automatically copies the file to the directory of your project.

If you do not select the file and the file is not in your project directory, the file can still be used, but once you copy the project to another place, this file cannot be found. Because this file is on your computer, not in your project.

 

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.