Making Content Pipeline build external images?

You can write a ContentImporter and store both the json and the textures in a single .xnb with something like output.WriteRawObject((Texture2DContent)atlas);
You can also have textures stored in separate .xnbs and linked from the main .xnb just like the Model processor does.

Here’s something close to what you want. It loads the images from a TMX file and stores it in a single .xnb with an embedded texture and some extra information extracted from the TMX. (warning: mipmaping generation still has bugs…) https://github.com/tainicom/Aether.Extras/tree/TextureAtlas/Content.Pipeline/AtlasImporter

2 Likes