Created a new project for WP. Using install-package command added reference for MonoGame 3.2 DLLs. The content is simply a PNG file placed under a folder named ‘Content’ in the same project (the content pipeline template is broken somehow, could that be the reason?).
Faced NOT Implemented exception at Content.Load<>(). Interestingly the same method works just fine with same setup in a Windows Store app. Please suggest?
K, seems FromStream() is also throwing NOT implemented exception.
But I want to start from scratch. Can you help me find ContentPipeline tool and a reference document detailing current and future of Content Pipeline in Mono Game?
Currently the Pipeline Tool is only available on Windows and is part of the SDK installation.
I installed 3.2 using Windows Installer. Couldn’t find it? Is this available on Git or not yet released and I can get the source and build from there? Just point me in the right direction please. Thanks
I dont use the content pipeline at all, except for SpriteFont. This is how I load my pngs (this is not my invention, i found it during googling my other problems ):
public Texture2D TextureFromStreamForWP8(GraphicsDevice graphicsDevice, Stream stream)
{
Texture2D result = null;
var image = new BitmapImage();
image.SetSource(stream);
var bitmap = new WriteableBitmap(image);
var pixels = SetColorsFromPixelData(bitmap.Pixels);
Texture2D texture2D = new Texture2D(graphicsDevice, bitmap.PixelWidth,
bitmap.PixelHeight);
texture2D.SetData(pixels);
result = texture2D;
return result;
}
private Color[] SetColorsFromPixelData(int[] pixelData)
{
var Colors = new Color[pixelData.Length];
for (var i = 0; i < pixelData.Length; i++)
{
var packedColor = pixelData[i];
Color unpackedColor = new Color();
unpackedColor.B = (byte)(packedColor);
unpackedColor.G = (byte)(packedColor >> 8);
unpackedColor.R = (byte)(packedColor >> 16);
unpackedColor.A = (byte)(packedColor >> 24);
Colors[i] = unpackedColor;
}
return Colors;
}