Replies: 1 comment 2 replies
-
I am not sure about what you are trying to do, but following some of your messages it seems that you are trying to work with texture atlases, though not a way you're intended to work with. Tell me if I understand it wrongly, but I feel like you are trying to give a spritesheet (a single image file containing multiple frames of sprites) to the MGCB, and wish that to be treated as if each of those frames can be loaded individually like This sounds like a misunderstanding of how spritesheet work and why they exist. Spritesheets are expected to stay a single unique texture/file with a single What you are likely looking into, is how to define those source rectangle and retrieve them at runtime, independently of how the texture is treated. A possible solution would be to simply put the rectangles position and size in a text file, and load that text file like a standard file and parse those rectangles. Some software export this for you, like Aseprite, which can export a spritesheet with a PNG containing all the frames, and a JSON file containing the rectangles. You would them load the PNG through MGCB, and the JSON manually. You could also look into MonoGame.Aseprite which propose importers and processors so that all of that is transparent to you (but before using it, I would suggest try doing it the manual way to assimilate the concept). If I'm wrong and you are really looking into splitting a spritesheet into individual files, then MGCB is likely not what you are looking for and I would rather look into how to split PNGs. |
Beta Was this translation helpful? Give feedback.
-
Can you tell me how to implement the construction of individual files? Let me give you an example: there is an atlas in which individual sprite regions are stored. When the atlas file is being built, separate sprites must be created and rebuilt (with a specific Importer and Proccessor). I looked at the ContentProcessor methods and found AddOutputFile() and addDependency() there. I think they will help me, but I don't even have a rough understanding of how these methods work.
Beta Was this translation helpful? Give feedback.
All reactions