Jump to content
  • Advertisement
Sign in to follow this  
Belos

Help with xna textures

This topic is 2205 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am a beginner in xna, I started with terrains. I got the code from the apphub samples: here, The code works fine but when I copied it to my project the rocks.bmp texture doesn't loadon the map.

Share this post


Link to post
Share on other sites
Advertisement

You need to add the texture to your content-pipeline too.


I copied exactly the code from the sample. So I think its already added.

Share this post


Link to post
Share on other sites
You copied the CODE but not the content like image files. Just drag and drop the image to your content project. Or click right mouse button on it and choose "add existing element". Pay attention to the LoadContent()-method.The relative path after Content.Load<Texture2D> has to be exactly the same as in your content-project.

Share this post


Link to post
Share on other sites

You copied the CODE but not the content like image files. Just drag and drop the image to your content project. Or click right mouse button on it and choose "add existing element". Pay attention to the LoadContent()-method.The relative path after Content.Load<Texture2D> has to be exactly the same as in your content-project.

I have added the "rocks.bmp" to the Content. I did not see the texture because it is not displayed on the whole terrain but only on the edges. Edited by Belos

Share this post


Link to post
Share on other sites
Okay, I somehow discovered the source of the problem. Its because I used the spritebatch. I used the spritebatch to draw a spritefont(frame rate). When I stopped using it the texture rendered correctly. I do not understand how the spritebatch caused the texture of the terrain to not to render correctly.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!