I decided to learn F# a while ago and to make it a bit more fun for myself I want to use XNA. There is only once issue I cannot seem to get over, and it has to do with the content pipeline. Basically, to draw a string I need a font. To get a font I need the content pipeline. But since I am using F# I cant seem to be able to access the content pipeline at all. So how do I draw text?
Note: To get F# and XNA running I just added the references to the XNA assemblies in Visual Studio. Dont know if there is another way, have not been able to find it.
Take care,
Kerr
One of the special features of the XNA “Game Project” and “Game Library Project” templates is that they are able to hold a “Content Reference” to an XNA “Content Project“. (Note that you will need XNA Game Studio installed.)
When you build the game [library] project, it will invoke the build of all the content projects that it references. The reason that the content projects don’t get compiled independently is that they can be built for different platforms (Xbox, Windows, etc) and for different profiles (Reach, HiDef) – these options are specified by the referencing projects (of which there can be many).
The simple way to do a content build for a non-XNA-Game project type is simply to simply create an empty “Windows Game Library Project” (or whichever platform you are targeting). Add your content reference to that library. And then reference that library from your project.
Visual Studio is clever enough to copy the content into your project’s output directory, when it copies the empty DLL.
Another option might be to use
MSBuild.exeto directly compile the content project. You will have to specify the platform and profile yourself, like so: