3

I can't understand how to set up monogame content project.. PLease, help me :) I tried to read this stuff: https://github.com/mono/MonoGame/wiki/MonoGame-Content-Processing But can't make this works...

What I'm do:

  • Create MonoGame project.
  • Add new project to solution "MonoGame Content"
  • Change main project file, added Input, Platform options
  • In references of main project add content project.

Then I add some.png file to content project, and here is what I see:

http://richinside-games.net/my/mono.jpg

I have no MonoGame Song, MonoGame Texture, etc...

Can some one tell me, how to set up monogame content step-by-step, please?

PS. Sorry for my English, please.

dmitryhryppa
  • 119
  • 3
  • 11

2 Answers2

7

Since the developers of MonoGame didn't want to have to rewrite the Content Pipeline from XNA they just reused it. That's why when you created a MonoContentProject it added 2 projects. 1 is a XNA extension (the_GameContent) that has the ability to reference a XNA content project and the other is the XNA content project itself(the_GameContentContent). What you need to reference in your Game project is the extension(the_GameContentContent). As for not being able to see the right processor is because the MonoGameContentProcessors Reference is messed up and needs to be deleted.

I found it easier and less of a mess to just compile your content outside of Visual Studio with the XNA 4.0 Content Compiler. Then create a folder in your game project called Content and just add the compiled content into that folder as an embedded resource and export it during LoadContent;

I am also currently working on a rewritten simplified version of the ContentPipeline to use with MonoGame instead. since the built in one makes it near impossible to create custom content.

Daniel Johnson
  • 691
  • 4
  • 14
  • Thanks for the answer! I tried to use empty XNA project for compile .xnb files, but what about shaders? And Xna Content Compiller can not compile shaders too. – dmitryhryppa May 18 '13 at 19:10
  • You can edit the Xna Content Compiller source and add support for Shaders. Not quite sure what all it takes to add support for shader tho. – Daniel Johnson May 18 '13 at 21:21
  • Thanks. Now it works :) Maybe you can help me with my new problem? :) http://stackoverflow.com/questions/16634752/how-to-use-shaders-in-monogame – dmitryhryppa May 19 '13 at 13:16
  • I recently posted the ContentPipeline i made to replace the XNA Content Pipeline. It only has Texture2D and SoundEffect right now but can be easily added onto. – Daniel Johnson Jun 04 '13 at 11:33
  • Wait, I'm confused. Do we need to reference the extension (the_GameContent) or the content project itself (the_GameContentContent)? – Rudey Nov 27 '13 at 19:19
  • BTW, what is the point of compiling content with the pipeline tool, as opposed to just directly loading sounds and images using Content.Load in C#? – Kokodoko Mar 21 '16 at 13:58
0

You can follow this link to see an explanation.

Basically you have to add a MonoContent project to the solution, edit the GAME .csproj file to include <Import Project="$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.ContentPipeline.targets" /> in the <Project> tag, and <MonoGamePlatform>Windows</MonoGamePlatform> in the <PropertyGroup> tag, for example:

<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.ContentPipeline.targets" /> <PropertyGroup> <MonoGamePlatform>Windows</MonoGamePlatform>

Then you need to make sure that the content processors are available at Program Files (x86)/MonoGame/v3.0/MonoGame.ContentPipeline.targets. The sources for these are in the repo and can be built from visual studio, and deposited there.

After all that, it should be business as usual, but things can get slightly trickier for other target platforms, the wiki explains all.

chrisvarnz
  • 439
  • 7
  • 17