Cocos2dx tips (1) pre-defined file path

Source: Internet
Author: User
After thinking for one night (if you believe), you can figure out a blog related to cocos2dx tips. It has the following features: 1. Simplified; 2. Practical; 3. occasional violence, yellow... our theme is: It doesn't matter if you don't know some tips, but it will be awesome if you know it. ------------------------------------- Enter the text below: Suppose

After thinking for one night (if you believe), you can figure out a blog related to cocos2dx tips. It has the following features: 1. Simplified; 2. Practical; 3. occasional violence, yellow... our theme is: It doesn't matter if you don't know some tips, but it will be awesome if you know it. ------------------------------------- Enter the text below: Suppose

After thinking for one night (if you believe), you can work out a blog related to cocos2dx tips. It has the following features:

1. simplified;

2. Practical;

3. occasional violence, yellow...

Our theme is: It doesn't matter if you don't know some skills, but it will be awesome if you know it.

-------------------------------------

Enter the text below:

Assume that there are many directories in the Resource of the project, such as image, fonts, Menu, and InterfaceUI. The images corresponding to the several genie that I want to create are in these directories respectively, for example:

auto sprite = Sprite::create("image/sp.png");

But what's terrible is that I have a poor memory (false). I forgot the directories where all the images are stored. At this time, I have to go to the directories to search for them. Is this very troublesome? (If you don't have any trouble, let me go out now! Out !).

There is a way to solve your troubles from the root cause, that is, to the male clinic... Well, I seem to have said something wrong. Don't care about such details. Please refer to the following:

// Add the following lines of code to the applicationDidFinishLaunching () function in Appdelegate. cpp:

Std: vector
 
  
Paths; // create a string-type container paths. push_back ("fonts"); // Add the path paths of the image directory to the container. push_back ("image"); paths. push_back ("sounds"); FileUtils: getInstance ()-> setSearchResolutionsOrder (paths); // set the path here. All we need to do is to put the created container in.
 
Well, I personally think this method is useful when creating small projects.

Of course, there are other ways to do this, mac... yes, it indicates that you have never used a mac. You just heard that you don't need to specify a path under the mac. You just need to throw the image name directly;

In win32, that is, VS, you can add additional directories. Of course, this has nothing to do with the topic of this article. I will not introduce it in detail.


Well, that's it. Not short enough... the amount seems to be ambiguous. Well


Http://blog.csdn.net/start530/article/details/22582207

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.