I created a new Windows Phone 8 Project using the 3.2 templates with Visual Studio 2013 and tried to run it on the emulator.
It just shows a black screen and doesn’t get to the cornflower blue screen we all know and love. When I do a step through, it does get as far as calling the constructor on the main game class, but t doesn’t get to LoadContent.
Do I need to install anything else? How can I work out what’s going wrong?
I have the same problem. The screen is always black. I tested it with WVGA, WXGA and 720p emulators. Why is the screen always black? I have Visual Studio 2012 Express for Windows Phone.
Same problem here.
Using: Visual Studio Professional 2012,
Debugging on Device: ARM
Happens to me too, both ARM and x86. Looks like the landscape template is not working correctly because of the use of DrawingSurface and not DrawingSurfaceBackgroundGrid.
Same here. Also, if I add the line
SoundEffect.MasterVolume = 0.3f;
An exception of type ‘System.NullReferenceException’ occurred in MonoGame.Framework.DLL but was not handled in user code
I tested it with Visual Studio Express 2013 for Windows, but I always get a black screen. What is wrong?
If your game is portrait then on GamePage.xaml you can swap the Grid for the DrawingSurfaceBackgroundGrid as described in the comment at the bottom of the template. That is working, but for some reason the Grid version which you need if you want to support a landscape game doesn’t seem to be working.
Thanx. The portrait mode works with this code.
<DrawingSurfaceBackgroundGrid x:Name="XnaSurface" Background="Transparent">
Just do what iv done and make the game in portrait and rotate everything to landscape by render to a back buffer then rotate and render to screen.
then in your Intiialize()
//the size of the backbuffer
BackBuffer = new RenderTarget2D(GraphicsDevice, 1280, 720);
Then in your draw
//enter your draw code here
gameBatch.Draw(BackBuffer, new Vector2(360, 640), null, Color.White, MathHelper.PiOver2, new Vector2(640,360), 1f, SpriteEffects.None, 0f);
MathHelper.PiOver2 will rotate one way and -MathHelper.PiOver2 will rotate the other way
you just need to work out the touch points as the will still report in portrait mode.
Of course you will need to handle the different size of screens, this code is only for 1280x720 as I haven’t got round to auto scaling for all screen sizes.
Use the above code provided by Fox9 to make the game run in portrait mode.
Yes, that could be a way to do it, but it is very ugly. Also, it nukes your performance because you’re basically drawing everything twice. The DrawingSurface should work (although also lowering performance)… There’s a problem with graphics device at these lines:
// Create the Direct3D 11 API device object and a corresponding context.
using (var defaultDevice = new SharpDX.Direct3D11.Device(SharpDX.Direct3D.DriverType.Hardware, creationFlags, featureLevels))
_device = defaultDevice.QueryInterface<SharpDX.Direct3D11.Device1>();
I’m using VS2012 Pro and I get the blank screen using the standard Landscape DrawingSurface
I noticed that the call to
will enter the Constructor of Game1 but the other methods like Initialize(), LoadContent() or Update() and Draw() are never called
I also downloaded the Platform2D sample (converted from XNA to monoGame) and this runs fine even in Landscape mode
I solve this problem by this way:
I created a new project called “Windows Phone XAML and Direct3D App”, then I deleted all code that related to cpp project in my solution and add MonoGame.Binaries references with Nuget.
After that I don’t have black screen and game works with any screen orientations!
I used VS2013. I suppose that MonoGame 3.2 Installer have defective Windows Phone 8 template.
<Grid x:Name="LayoutRoot" Background="Transparent">
<DrawingSurface x:Name="DrawingSurface" />
_game = XamlGame<MyGame>.Create("", this);
You’re welcome I also try to do the same thing with Windows Phone App template and it also work But you need to specify platform x86 or ARM for Emulator or Device respectively in the solution properties.
So what is the difference between the original template and mono template? We need a new template then… What can I do to fix my app? (it is well off into development…)
EDIT: I tried now making my own template as you said from xaml+direct3d and it doesn’t load… Can you upload your project?
MiShu, your template worked like a charm–and I was one step away from deleting my MonoGame downloads for the sixth time and giving up on this whole toolkit as an unusable, non-functional piece of junk. So thank you!
I have this problem too. So the Windows 8 template is not working?
@bangclash it is working fine. Just the installer version of templates are broken, they are fixed on the Nuget.
For fixing the problem for Windows Phone 8, you just need the use nuget and install new MonoGame temp ( with dll’s and all ).
Code : Install-Package Monogame
But you have to do this very carefully, it will ask you to replace Game1.cs and some other files. Do this only if you have empty Project.
PS : Let the nuget change all files exept Game1.cs
@semihmasat, I open my existing project and installed monogame through nuget and everything works. Thx.