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

Shared ContentManager

Last post 11/3/2009 12:55 AM by MJP. 2 replies.
  • 11/2/2009 8:08 PM

    Shared ContentManager

    Heya, I'm trying to use some shaders in both my game and editor projects. I was hoping to add them as normal content in my Shared project, but I can't figure out how I would then access the content. The ContentManager constructor seems to assume that you want to load content from the same project. Is it possible to have a setup as I described or must I resort to duplication?
  • 11/2/2009 8:32 PM In reply to

    Re: Shared ContentManager

    You might look at this sample for how to load content for your editor.
    Jim Perry - Microsoft XNA MVP
    If people spent a minute searching the forums and reading the FAQs before posting I'd be out of a job.
      Got some XNA Game Studio/XNA Framework development info to share with the community? Put it on the XNA Wiki.
        Please mark posts as Answers or Good Feedback when appropriate.
  • 11/3/2009 12:55 AM In reply to
    • (2330)
    • premium membership MVP
    • Posts 1,220

    Re: Shared ContentManager

    Olle Hakansson:
    Heya, I'm trying to use some shaders in both my game and editor projects. I was hoping to add them as normal content in my Shared project, but I can't figure out how I would then access the content. The ContentManager constructor seems to assume that you want to load content from the same project. Is it possible to have a setup as I described or must I resort to duplication?


    If you have an XNA Game project that references an XNA Game Library project, all of the .xnb files built by the XNA Game Library's content project should be copied over into the "Content" subfolder of the Xna Game project's output folder. Then you can just load that content normally with a ContentManager. Do you see the .xnb files getting copied into output folders of your game and editor projects?
    Matt Pettineo | DirectX/XNA MVP


    Ride into The Danger Zone | PIX With XNA Tutorial
Page 1 of 1 (3 items) Previous Next