Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2013
    Location
    Ireland
    Posts
    5

    Unhappy XNA 4.0 Content problems

    Hey,

    I've been having trouble all day with this and can not find a solution:

    When I want to print a sprite in XNA 4.0 with this code, it will not work:


    Code:
    protected override void LoadContent()
            {
                // Create a new SpriteBatch, which can be used to draw textures.
                spriteBatch = new SpriteBatch(GraphicsDevice);
    
                MySprite = Content.Load<Texture2D>(@"Content\sprite1.png");
    
                // TODO: use this.Content to load your game content here
            }

    But there is no default content folder like there used to be in 3.2

    I set up my own content folder.


    Thanks for your time and help, I will always leave a thanks post on my site when its done, I will remember you guys xD


    Pride yourself on gif's!

    Downloading the interwebs



    Code:
    if happy = 0
    then sadness = 1
    print 'Take a chillpill and relax'
    feeling = raw_input('type 1 for relaxed type 0 if not')
    if:   
        relax = 1
        print 'You are happy now'
    else:
        relax = 0
        print 'Be happy and proud'

  2. #2
    Join Date
    Jun 2012
    Location
    probably at a PC
    Posts
    308
    Could you please be more clear about what you mean with "I want to print a sprite in XNA 4.0"?

    I'm assuming you're trying to DRAW a sprite. The content folder as you would see it in previous XNA versions is now considered a separate project and your main project would simply hold a reference to it.
    If you're upgrading an existing XNA3.x project, you will have to ADD a NEW PROJECT and choose "Empty Content Project". You also now need to make sure there's a reference to it under "Content References" in your main project.

    Best way to figure this out, is to take an existing sample project for XNA4 and compare it to the 3.x project. There are really not that many changes needed for most simple projects to be upgraded.


    PS: Would you mind lowering the amount of stuff you got in your signature?! It's confusing and takes up a lot of screen-space. Also, I don't think this post is supposed to be in the "Support" forums (as it has nothing to do with support on 3DBuzz or this website), but in should be in the "C#" forums.
    Last edited by nGAGE; 10-07-2013 at 05:44 AM.

  3. #3
    Join Date
    Oct 2013
    Location
    Ireland
    Posts
    5
    Ok advice taken,

    Signature ill fix it soon,
    I'm only new tithe site sorry bout this
    Pride yourself on gif's!

    Downloading the interwebs



    Code:
    if happy = 0
    then sadness = 1
    print 'Take a chillpill and relax'
    feeling = raw_input('type 1 for relaxed type 0 if not')
    if:   
        relax = 1
        print 'You are happy now'
    else:
        relax = 0
        print 'Be happy and proud'

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •