使用MonoGame 3.4设置Windows Phone 8应用程序的分辨率时出现问题 [英] Problem to set the resolution for a Windows Phone 8 App with MonoGame 3.4

查看:98
本文介绍了使用MonoGame 3.4设置Windows Phone 8应用程序的分辨率时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!



我尝试在Windows Phone 8应用程序的构造函数中设置分辨率。但是这个决议不会被采纳。另外我可以看到我的graphics._graphicsdevice仍然是null。

MonoGame(3.4)有任何已知问题吗?



环境: Windows 8 + Visual Studio 2012 + Monogame 3.4

(由安装程序安装的MonoGame - 不是由NuGet!)



只需打开一个新项目 - > MonoGame - > MonoGame Windows Phone 8 Project。

转到Game1.cs并更新Game1构造函数,如

Hi!

I try to set the resolution within the constructor of the "Windows Phone 8" application. But this resolution will not be taken. Also I can see that my "graphics._graphicsdevice" is still "null".
Is there any known issue with MonoGame (3.4)?

Environment: Windows 8 + Visual Studio 2012 + Monogame 3.4
(MonoGame Installed by the installer - not by NuGet!)

Just open a "new project" -> "MonoGame" -> "MonoGame Windows Phone 8 Project".
Go to "Game1.cs" and update the Game1 constructor like

public Game1()
{
   graphics = new GraphicsDeviceManager(this);
   Content.RootDirectory = "Content";

   graphics.PreferredBackBufferWidth = 600;   // only new line!
   graphics.PreferredBackBufferHeight = 300;  // only new line!

   //  graphics.ApplyChanges(); // not needed - but tried without success!
}



使用XNA将新分辨率设置为给定值。使用Monogame 3.4使用选择模拟器的默认分辨率。



如果有人能够帮我解决这个问题,那就太棒了。



提前致谢!

Agenor


Using XNA the new resolution is set to the given values. Using Monogame 3.4 the "default" resolution of the choosen emulator is used.

It would be great if somebody is able to help me with this problem.

Thanks in advance!
Agenor

推荐答案

好的,我发现了这个:

OK, I found this:
MonoGame doesn't do anything with graphics.PreferredBackBufferWidth or graphics.PreferredBackBufferHeight – if you used their 800×480 defaults in your XNA game, you'll find that they're zeroed in MonoGame and setting them to anything else has no effect on the game's behavior.



所以我会关注这里的说明: http://social.technet.microsoft.com/wiki/contents/articles/27180.windows-phone-auto-scaling-wvga-xna-games-to-wxga-720p- with-monogame-for-wp8.aspx [ ^ ]



没想到MonoGame和XNA之间存在这种差异,并且遗漏了一些样本。但我猜这种变化主要是由Windows Phone 8.x引起的。


So I will follow the instructions here: http://social.technet.microsoft.com/wiki/contents/articles/27180.windows-phone-auto-scaling-wvga-xna-games-to-wxga-720p-with-monogame-for-wp8.aspx[^]

Didn't expect such difference between MonoGame and XNA and missing some samples. But I guess this change is mainly caused by Windows Phone 8.x.


这篇关于使用MonoGame 3.4设置Windows Phone 8应用程序的分辨率时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆