I'm pretty new to MonoGame and XNA in general. So was wondering how I could import custom content and make it work on any platform. So I came across Content Pipeline Extensions wanted to do it like the documentation says but i cant find MonoGame.Framework.Content.Pipeline.
So I have multiple questions:
- Where is it located?
- Is there any other way i can load stuff like map data etc.?
- If yes does it work on any platform?
Edit:
I can simply load files without the content pipeline. I didn't expect that to work across all platforms. Thanks to Shiro for clearing this up.
Answer
The MonoGame.Extended project loads Tiled maps using a custom content importer. I wrote a tutorial about how to create custom content importers on my blog.
Of course, as @Shiro mentioned in the comments you don't need the Pipeline to load your own content with MonoGame. Just be aware that to make it work across all platforms you'll need to use TitleContainer.OpenStream
. This is by far the simplest way and if it works for you by all means do it that way.
The idea of using the Pipeline is to give you the opportunity to optimize the content at compile time. You can pre-process the data and write it out as a binary XNB file to be efficiently read into the game. The process is quite involved though:
- Create a new project to hold your content importer, processor and writer that references the
MonoGame.Framework.Content.Pipeline.dll
. It's available as a NuGet package. - Implement a class that derives from
ContentImporter
- Implement a class that derives from
ContentProcessor
- Implement a class that derives from
ContentTypeWriter
- Implement a class that derives from
ContentTypeReader
(in the game project) - Reference the DLL from the Pipeline tool (by editing your
Content.mgcb
file) - Read the content into your game using
Content.Load
As you can see custom content importers can be quite daunting at first, but once you've done a few of them they are not too bad. I hope this clears some things up for you.
Finally, to answer your other question.
Where is it [MonoGame.Framework.Content.Pipeline.dll] located?
If you're not using the NuGet package for some reason, the DLL lives with the Pipeline tool in a rather obscure place. On my machine it's located here:
C:\Program Files (x86)\MSBuild\MonoGame\v3.0\Tools
I found it by looking at the path set on the shortcut in the start menu.
No comments:
Post a Comment