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

So I cant load a sprite

Last post 05-03-2008 5:01 PM by christianv. 7 replies.
  • 04-24-2008 6:15 PM

    So I cant load a sprite

    I recently became interested in using XNA to make my own simple games just so I can view my ideias born in a game.
    I started with some net tutorials because this site no longer has updated tutorials to get started since the recent version is 2.0 and not 1.0.

    So I cant load a sprite to the screen. It shows me this:
    http://img171.imageshack.us/img171/9610/stupides1.jpg

    Anyone?
    I writed this in the Load Content Method:
    mSpriteTexture = this.Content.Load<Texture2D>("SquareGuy");

    Am I doing something wrong?
  • 04-24-2008 6:22 PM In reply to

    Re: So I cant load a sprite

    Did you add the SquareGuy content to the Content project? Did you accidentally have a different name on the file? Is it actually in a subdirectory you forgot to specify? Did you set "Content.RootDirectory = "Content";' in the constructor of your game?


    Nick Gravelyn -- Microsoft XNA MVP
    Blog | Metacreature Games | Super Gravelyn Bros | Bloc | Next-Gen
  • 04-24-2008 7:21 PM In reply to

    Re: So I cant load a sprite

    Yes I did all that
  • 04-24-2008 10:08 PM In reply to

    Re: So I cant load a sprite

    Why is your Content project showing on the same level as the game? How did you set up the solution? When you compile the project is that texture being output?


    Jim Perry - Microsoft XNA MVP
    Here's what I'm up to.
    If people spent a minute searching the forums before posting I'd be out of a job.
  • 04-25-2008 5:45 AM In reply to

    Re: So I cant load a sprite

    I have no idea what you are talking. Again I just started this week I am not a expert
  • 04-25-2008 11:36 AM In reply to

    Re: So I cant load a sprite

    How did you create the project which is shown in that screenshot?

    It looks very odd, not how a normal Game Studio project should be, so I'm thinking you must have done something unusual while creating it.

    Are you using Game Studio version 1 or 2?
    XNA Framework Developer - blog - homepage
  • 04-25-2008 8:21 PM In reply to

    Re: So I cant load a sprite

    Well, your project is strange.
    Your contents should be in a sub-project, inside the main project. But this is not happening.
    Shine on You Crazy Diamond
  • 05-03-2008 5:01 PM In reply to

    Re: So I cant load a sprite

    Hi,

    I see your project you have the class view enabled, just open the solution explorer and the view should be fine.

    Ok as far as I can tell, open solution explorer, click on content folder and then click on build, this will compile the content, then make sure than you use the name of the content object not the name.xnb.

    Hope this help, I have the same problem sometimes so I need also to re-build the content separate from the solution.

    hope this helps .. tuke me a while to figure out.

    www.cdktech.com - http://www.lab13.co.za/
Page 1 of 1 (8 items) Previous Next