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.
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.
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.
Related
Background
I'm porting a small Windows application to iOS using XCode 6.2 as both the IDE and build platform. I have a workspace created, which I'm using to compile and build all the projects. I currently build every project except the actual iOS app as a dynamic library, and then embed it in the final app package on deployment.
The Problem
I'm currently hard coding relative paths in the projects. Stuff like ../../shared-headers - I really don't like doing this as I have to figure out this path per project, and I'd prefer to use something like props files in Visual Studio, which would let me do something like $(SHARED_HEADERS) in projects.
This makes the projects easier to maintain, and any dependency extremely obvious. It also makes it much easier to move projects when the need arises. What is the preferred method to do this in XCode?
EDIT: I'd like to stick with a Visual Studio-ish include structure. While Copying headers is a good way to manage some of the complexity, I do not prefer this method because it will add time to the build, and developers from Windows will not be expecting this.
I too was looking for the same thing, and i've just found it! using an xcconfig file!
Create a .xcconfig file either from xcode's file menu or just a simple text file, and add your entires like so:
PATH_TO_SOME_SDK = Volumes/DEV/Project
SOME_DEFINITION = 7
once you add that file to the project, you can add it (or different ones) to each configuration in the project's info panel under "Configuration".
the definitions along with their values will then appear in the project's build settings under "User-Defined", and will change dynamically as the value in the file changes.
you can then use the values in any other build setting like any other environment variable or macro:
$(PATH_TO_SOME_SDK)
for more info:
https://nshipster.com/xcconfig
https://medium.com/better-programming/working-with-xcode-configuration-files-398cfbe02b64
https://help.apple.com/xcode/#/dev745c5c974
better late than never...
:-)
I've been playing around with the Starter Edition of Xamarin Studio to determine if it will meet my needs. I understand (so I thought) the limitations of this edition; 32K compiled IL limit, no native libraries, etc. Now, I understand native libraries to be C/C++ libraries, or even native Java libraries. This does not seem to be the case.
I have a solution in Xamarin Studio with 2 projects. One is an Android Class Library, the other is an Android Application. When I reference the class library from the application project and build, I get the following error.
Your app references native libraries. This functionality requires Indie Edition or higher.
I beg to differ! Every .cs file in the referenced Android class library project is simple .NET code. What am I missing? I can successfully run the Tasky Android_Starter solution without issue, and it is made up of 2 projects like mine.
I had to delete the Resources folder and manually edit the Android class library project file in order to get this working. I looked at the Tasky sample's project file as a reference.
After deleting the auto-included Resources folder from the project, edit the .csproj file in a text editor to remove the following XML elements:
Project\ProjectGroup\AndroidResgenFile
Project\ProjectGroup\AndroidResgenClass
With those things taken care of, I no longer get the error. I'm guessing, Xamarin Studio thought I was referencing another Android application instead of a class library. Not sure why the default project template includes things to break such a flow, but perhaps I'm not "doing" right" either. Go figure.
Deleting the Resources folder and manually editing the csproj file didn't work for me. I had to create a new C# Library project instead of creating an Android Library Project and import my .cs files into that. After that it compiled and ran fine.
I can get the simplest possible WP7 project converted, but no luck figuring out where the sprite font files, etc should go... I took a look at some Android samples and that didnt help.
You simply add your Content folder to your MonoDevelop project and set the files to the "Content" build type. All those files will be packaged with the executable.
Can I reference a Content Project to a Non-XNA project (MonoGame, if it's important)?
Not directly.
The ability to add a content project reference to a project is only available for projects of the types "XNA Game" and "XNA Game Library".
One trick that I use when I want to build and include an XNA Content Project in a WinForms project is to make an empty XNA Game Library project. Reference the XNA Game Library project from the main (Windows) project, and the Content Project from the XNA Game Library project.
Whether this will work for MonoGame is another matter.
The alternative is to simply have a blank XNA Game project that references the content project. Then set up the project dependencies so the XNA Game will rebuild first if necessary. If you need to copy the output files around, perhaps do it as a post-build step?
The sledgehammer option would be to create a custom MSBuild file that does exactly what you want.
I know you already have it solved but yesterday I was having the same problem, Tom Spillman sent me this link:
https://github.com/mono/MonoGame/wiki/MonoGame-Content-Processing
So apparently you can reference it directly
I have XNA Game Project (game) with (by default) contains a nested Content Project.
I want to reuse this nested Content Project in another Project (game editor) in the same solution.
I've added Content Reference, but content files are not copied to the output directory (content directory is created but empty).
Somebody know how to solve this ?
I got the answer...
The solution is to add a Game Library project and add a reference to Content Project to Game Library project. After that simply refer to Game Library in all the projects that needs access to Content Project:)
Some references:
http://xboxforums.create.msdn.com/forums/p/35208/202471.aspx#202471