user2396965
user2396965

Reputation:

Monogame Content pipeline don't work

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:

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.

Upvotes: 3

Views: 7192

Answers (2)

chrisvarnz
chrisvarnz

Reputation: 457

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.

Upvotes: 0

Daniel Johnson
Daniel Johnson

Reputation: 701

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.

Upvotes: 7

Related Questions