The first contact with xNa about loadcontent

Source: Internet
Author: User

I suddenly became interested in game programming and started to learn xNa to reduce the boring work at ordinary times.

Today is the first day of study. Happily posted this document <xna4.0 Learning Guide>, or the Chinese version. I was a little excited at the beginning of the introduction. When you see the first xNa example, you can immediately start the process.

As a result, I quickly met a Buddha. I want to load an image by setting its attributes as content in the project. HoweverProgramWhen you run texture. Load () in the loadcontent () method, a loading error is always prompted. Either the system prompts "cannot open file" or "file not found.

After ensuring that the path is correct, the program still does not work properly. I had to worry about it. I had to urinate and felt helpless and uncomfortable.

I then looked back and read the materials carefully. I suddenly saw a sentence: all the resources you used in the game should be put in the project projectnamecontent (content), rather than under the main project.

I had a thorough understanding that such a simple problem had been entangled for so long, but it was caused by the lack of good-looking references and the lack of resources.

After the resource location is corrected, it can be started properly. It's really sad, so I can't name it.

Let's take a look at the documentation. It's not a mistake to cut firewood workers, so it's just a breeze ~

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.