XNA Creators Club Online
Page 1 of 1 (4 items)
Sort Posts: Previous Next

Please delete topic

Last post 9/5/2009 5:11 PM by Shawn Hargreaves. 3 replies.
  • 9/5/2009 4:01 PM

    Please delete topic

    I wanted to delete this topic and start a new one, but you can only edit topics.
    When I started editing it, no one had replied yet. I just took a while editing it and a reply was made in the meantime.

    I made a new topic about my current question.
  • 9/5/2009 4:54 PM In reply to

    Re: File not found?

    Megidolaon:

    I can display "testing" just fine with this code:
    tile = new Texture2D(graphics.GraphicsDevice, 780, 180); 
    tile = this.Content.Load<Texture2D>("testing");


    You don't need the first of those two lines. This code is creating a new texture and storing it in your "tile" field, then loading a different new texture from disk and storing that into the "tile" field instead, which replaces the texture that was created in the first line. The first line is creating an unnecessary object which you immediately discard.

    Megidolaon:
    If I substitute the "testing" with "background1", I get the file not found error.


    Most likely causes:

    • Is your "background1.png" file set to build using the same options as the "testing" one? (look in the Visual Studio properties pane for each asset to compare them)
    • Is the "Name" property for "background1.png" set to something other than "background1"?
    • Are you sure you didn't make a typo in the name?

    Megidolaon:
    Also, how would I go about displaying images from subdirectories


    Pass whatever path your file lives at, eg. Content.Load<Type>("FolderA/FolderB/AssetName");
    XNA Framework Developer - blog - homepage
  • 9/5/2009 5:08 PM In reply to

    Re: File not found?


    Thanks for the quick answer, but I remembered that I have to add the files to the content in the project.

    I wanted to delete this topic, but since you can't I changed it to another problem that popped up right afterwards.
  • 9/5/2009 5:11 PM In reply to

    Re: File not found?

    Please create a new topic if you have a new question. Changing posts after people have replied to them is just confusing.
    XNA Framework Developer - blog - homepage
Page 1 of 1 (4 items) Previous Next