[Cocos2d-x from c ++ to js] 02: Fixed invalid modification of js source files in

Source: Internet
Author: User

Previously we talked about how to import the cocos2d-x engine's built-in MoonWarriors example project into the source code, and then you can easily learn and edit. However, I found that if I modified the js Code and click debug, the runtime will still be the previous result and will not change. What's going on? After careful observation, I found that for cocos2d-x for js, js script is just a resource file, he will execute a batch processing when generating the project, this batch is used to copy the resource file to the corresponding directory. We can see that this batch is executed only when the project is generated, that is, after the project code is modified. But as you can see before, this is a c ++ project, and js scripts only serve as resources. So there is really no way? In fact, it is very simple. vs2010 has a generation tool selection function that uses different tools to process different file types. Right-click the js source code file in all projects and click Properties. The following type is displayed: "do not participate in generation". This is the problem because you do not participate, so vs will not monitor the changes to this file. We changed it to a "Custom generation tool". Then, we changed the js source code and ran the project directly in the green triangle. As you can see, the project is re-generated, and vs automatically copies the js file.

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.