-
Notifications
You must be signed in to change notification settings - Fork 5
Xamarin Studio Content Pipeline Addin (In Progress)
For those of you not working on a Windows machine, or not those not wanting to install XNA Game Studio. There is now an Addin for Xamarin Studio which will allow you to build certain content types on Windows and Mac.
Make sure you are running the latest stable Xamarin Studio.
-
Download the approrpiate Addin for your operating system
-
In Xamarin Studio
- On Mac, click Xamarin Studio->Add-in Manager
- On Windows click Tools->Add-in Manager
-
On the first page click the "Install from File" button and select the .mpack you downloaded in step 1.
-
Close the Dialog and Restart Xamarin Studio
At the moment the Addin only compiles the following content
- Textures
- SpriteFonts
For other content you will need to use XNA. In addition the ability to add a Content project to a MonoGame project is not yet supported. So for now the best way to work is to link to the .xnb files produced by the Content Project.
In order to target a specific platform you will need to change the MonoGame Build options. You can do this by Right Clicking on the Content project and selecting Options. You will see the MonoGame Build tab in the list of available tabs.
The MonoGame Platform drop down contains all the platforms that are available, you will need to select the platform you are working on for the pipeline to generate the correctly formatted content. For example for iOS textures are compressed using PVRTC rather than DXT, this allows those textures to be loaded directly into the GPU, this saves on load time and GPU memory.
The platform selection is "per configuration" so you can add multiple configs for each platform. That said allot of platforms share the same formats so its possible to double up and reuse assets between platforms that match.
The following Image formats are supported on all platforms
- png
- bmp
When compiling a texture the there are a few properties that you can set to change on the TextureProcessor. The most important one is the TextureFormat, this has 3 possible values Color, DXTCompressed, Compressed. The default is Compressed. When this option is set the pipeline will automatically attempt to compress the texture using a format specific to the platform you are compiling for. As mentioned earlier in the case of iOS this format is PVRTC, however there are some restrictions on its use. In the case of PVRTC textures MUST be power of 2 and square (i.e width == height). If the pipeline cannot compress the texture it will fall back to Color.
Another property is ForcePowerOfTwo, if this is set to true your texture will be automatically resized to be a power of 2. The following grid will give you an idea of which compression formats are used on each platform.
| Platform | Texture Compression | Power of 2 required | Must be square |
|---|---|---|---|
| iOS | PVRTC | yes | yes |
| Windows 8 | DXT | yes | no |
| Windows Phone 8 | DXT | yes | no |
| Windows (DirectX) | DXT | yes | no |
| Windows (OpenGL) | DXT | yes | no |
| Linux | DXT | yes | no |
| MacOS | DXT | yes | no |
| Android | DXT | yes | no |