Building and loading content at runtime?

I am also a little late, I was on holiday, well that’s my excuse. :grinning:

Anyway, I had the same problem. The way I solved it was to write a class that extends ContentManager.

From within this you can still use pre-built content, but if the content is not there you can fall back to manual loading.

At the moment I am handling my custom content types this way instead of using a new content importer, and I handle textures by loading them into memory and then creating a Texture2D from the MemoryStream.

The reason I do this is two fold.

  • I am streaming content on a background thread.

  • The game is designed to be modded after release.

It actual fact it is very easy to do and although slower than using pre-built assets works incredibly well.

If you have problems send me a line.