Thursday, November 17, 2011

Embedding XNA Content in Compiled Code


I recently discovered that you can use the Content Pipeline in conjunction with a resource (as in .resx). This is very useful for embedding resources in a .dll if you need to ship your library with textures or models.

Compile any content you want with this project and add the resulting .xnb to your .resx.

Then create an instance of the ResourceContentManager class and load the content in the same way as you are accustom to doing with a content project.

No comments:

Post a Comment