Jump to content

  • Log In with Google      Sign In   
  • Create Account

Sharing content between WinForms project and XNA game project


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 CC Ricers   Members   -  Reputation: 623

Like
1Likes
Like

Posted 08 February 2013 - 02:59 PM

I've made a XNA library which serves as a graphics engine for a game I'm making. The game project references the library as a .dll. Currently the library has the assets it requires (effect files, default textures, etc) embedded in a resource file so I can copy just the .dll file and nothing else and it works fine.

 

What I want to do next is create a level editor for the game as a WinForms project. I'm using this WinForms example to start on, and I managed to get a screen rendering with the engine properly. Where I'm having problem is with using the game assets. The game project compiles the assets as .xnb's and I would like to use these files in the editor. How should the editor reference these files?

 

Since WinForms projects cannot use XNA Content projects directly, I created a standard project called "Editor Content", and then have that refer to the game's Content project. The problem with this is that all the game's content files get recompiled every time I compile the WinForms project, even if none of these files have been changed. Ideally I want to the game's .xnb's to be copied automatically to the editor's working directory. However, if there is a better way to share the assets between a XNA game project and a WinForms project, let me know.


Edited by CC Ricers, 09 February 2013 - 01:00 AM.

My development blog: Electronic Meteor

Sponsor:

#2 Stuntdk   Members   -  Reputation: 431

Like
1Likes
Like

Posted 09 February 2013 - 02:52 AM

In the always popular Nick Gravelyn Tile Engine series, he uses the Winforms project in his editor.
Perhaps you can get some hints from those.

I think it's videos 3B, 4B that starts the editor development.

http://www.youtube.com/playlist?list=PL0A865073DA96A7DA

#3 CC Ricers   Members   -  Reputation: 623

Like
0Likes
Like

Posted 11 February 2013 - 02:42 PM

In the always popular Nick Gravelyn Tile Engine series, he uses the Winforms project in his editor.
Perhaps you can get some hints from those.

I think it's videos 3B, 4B that starts the editor development.

http://www.youtube.com/playlist?list=PL0A865073DA96A7DA

 

While this doesn't answer my question directly, I did look at the videos and found them helpful not just in loading content but in using WinForms in general to make a level editor, so I'm gonna bookmark those. I also looked at the other XNA WinForms sample that compile .xnb content on the fly. That seems like a good enough solution for my needs.


My development blog: Electronic Meteor

#4 LordRhys   Members   -  Reputation: 355

Like
0Likes
Like

Posted 12 February 2013 - 06:49 AM

you could also look atthe RPG tutorial from here: http://xnagpa.net/xna4rpg.html , the Editor is WinForms and he uses the Content pipeline from the game to access the resources






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS