Jump to content

  • Log In with Google      Sign In   
  • Create Account

Create xna resource files at runtime?


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
2 replies to this topic

#1 Kaze   Members   -  Reputation: 948

Like
0Likes
Like

Posted 14 August 2012 - 12:52 AM

Is it possible to compile images or sounds into xna resource files at run time, for example so the game level editor could have new tiles added without having to recompile?

Sponsor:

#2 Flimflam   Members   -  Reputation: 657

Like
1Likes
Like

Posted 14 August 2012 - 01:33 AM

There's two things you can do for loading images, and only one, vastly unpreferred method for everything else.

1) You can load images into textures using Texture2D.FromStream(). It only loads jpegs, pngs, and bitmaps if I recall correctly. Any other format you will need to load yourself and manually set into a texture.

2) The other option is to include the XNA framework with your level editor, so you can invoke the content pipeline at runtime. This option is laughable, really, because it would require your end users install the xna framework, c# express (can't install xna without this), and the full .net 4.0 framework (ditto). In total, that's a few gigabytes of data which is relatively unrealistic to expect of your users and one of the main criticisms I ultimately have with XNA. Sounds, Sprite Fonts, Meshes, etc all would require this option to compile into xnb files at runtime as the Content Pipeline is not included in the standard runtime.

I never looked into it but there may be third party file converters out there that you may be able to utilize.

#3 Kaze   Members   -  Reputation: 948

Like
0Likes
Like

Posted 14 August 2012 - 10:15 AM

Option #2 is workable since I don't intend to distribute the content editors with the game.

In xna I have found both the content manager annoying and integrating a xna window with winforms takes a lot of workaround solutions.

With both I understand xna was made with consoles in mind but even your exclusively targeting the xbox 360 isn't it a given that you would want to make a level editor if your making anything more complicated than pong or tetris.




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