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
Related
I have two xcode projects one is a Gstreamer project( using Gstreamer single view templet) and other is a single view ios application. Now I want to integrate them into a single project. How can I do that.
Few things that I have tried:
1. I created a new project and copied the .xcodeproj files of both projects but I did not know what to do with the main.m file and storyboard file(I have one storyboards in gstreamer project and one in the other).
2.I tried copying the the UI project into Gstreamer project.
3.Tried copying gstreamer into UI project.
Should I create a Gstreamer project and the UI project into it or vice-versa or should I create a normal project and add both the projects into it.
I am really confused.
Please suggest the right way of doing this.
This makes a lot of sense when you are trying to integrate two project into one. There are a couple steps required for doing this.you can refer following link to do this. Xcode 4.2 how include one project into another one?
simple drag .xcodeproj files to xcode navigator area -> your folder.
something like this.
I have a number of XCode projects which are libraries for a game (Core, Renderer, IO, etc). These library projects have their own library dependencies, e.g. Renderer relies on OpenGL. Whenever I add these projects to a parent project I need to re-add the library dependencies to the parent in order to link correctly (e.g. I have to add Opengl libs to the game project even though the Renderer library already specifies it).
Is there a way I can set the parent project to automatically link against the libs in the child projects?
Thanks
Allan
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.
I'm working on an iOS app where I use third party libraries. I want to migrate my project to use ARC, but the third party libraries are still using the old memory management. So I want to separate third party code and put it in a separate project without ARC, and then somehow link that project into my iOS-app project, so that they will be built together using the same configuration.
Is this possible to do in a very simple way, or am i better of just turning off ARC for the individual files? (seems very tedious..)
Can I use a workspace? Where one project is my iOS app and the other just contains third party code?
I've played around a bit and googled a lot, but there just doesn't seem to be any simple soultion, or am I wrong?
So I figured it out myself, with a lot of help from different blogs. Something this basic should be more trivial and well documented... But here we go, this is what I did to get a library for AsiHttpRequest:
Create a new iOS project. Select the 'Cocoa Touch Static Library' template. Call it whatever you like. You don't want to tick 'Use automatic reference counting', since AsiHttpRequest does not support it.
Select a location for your library project (will matter later on).
Delete the default .h- and .m-file created by Xcode.
Drag and drop the AsiHttpRequest files into the project
You can add the frameworks that AsiHttpRequest is dependent of, but you will have to add them to your main project anyway, so it is not necessary.
Try to build the project, it should do so without errors.
Open your main project
From finder, drag your library .proj-file into your main project (in Xcode, so that it 'lands' onto the main project file)
The library project should now appear under your main project (still in XCode). It should be expandable and you should be able to see the library project files as well. If it doesn't, try closing all open projects and reopen the main project.
Select the main project, and select target. Under Build Phases - Link Binary With Libraries, click the +-sign.
In the list of frameworks you should see your library project (called something like libname.a). Select that file
The newly added file might appear red in the list of frameworks, don't worry, it works anyway. Guess it's a bug.
Still under target, go to Build Settings
Under Header Search Paths add the relative search path to where the library .h-files are. This is relative to your main projects .proj-file. (For example ../some folder/libproject/)
Hopefully your main project will build without errors and the library project will be built at the same time, using the same configuration as the main project.
I have no idea if this is a good approach or if there is some easier way to do it. However, I like this, since I can use the library project in several projects. And if I want to update the library project, I only have to do it in one place, and the other projects will be updated as well, since they all reference the same project.
Edit1:
I had some problems with library projects using objective c categories. I received unrecognized selector sent to instance errors in runtime when trying to call those methods. This problem was solved by following the answer given here.
Go to build settings of the target in the main project and add -ObjC to the entry called Other Linker Flags
Edit2:
I found this template for creating Universal frameworks. I haven't tried it, but I guess something like this would work as well.
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