Xna全屏大小问题 [英] Xna Full Screen size problem

查看:84
本文介绍了Xna全屏大小问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我有一个1-2个月前制作的游戏。当时我将鼠标放在屏幕的右下角并检查了鼠标的X和Y位置,它显示了1360和760(所以我的全屏尺寸是1360 * 760)。现在我最近更新到Windows 8.但是现在当我将鼠标放在右下角并再次检查其位置时它的1280 * 720.我甚至使用了GraphicsDevice.Viewport.Width / Height检查全屏大小但是相同(1280 * 720)。

但是,我可以使用

So I have a game that I made 1-2 months ago.At that time when I placed my mouse at the bottom-right corner of the screen and checked the mouse's X and Y positions,it showed 1360 and 760(so my full screen size was 1360*760).Now I recently updated to Windows 8.But now When I place my mouse in the bottom right corner and check its position again its 1280*720.I even used GraphicsDevice.Viewport.Width/Height to check the size of the full screen but its the same(1280*720).
However,I can change the size of the game screen using

graphics.PreferredBackBufferWidth = 1360;
           graphics.PreferredBackBufferHeight = 760;



然后我得到一个窗口屏幕。我想要我的电脑全屏(现在是1280 * 720)再次是1360 * 760.我该怎么做?

请帮助我!!必须有办法...


but then I get a windowed screen.I want the full screen of my computer(which is 1280*720 right now) to be 1360*760 again.How do I do that?
Please help me!!There MUST be a way...

推荐答案

不,必须不是一种方式,对不起。并非所有可能的模式都可用。这实际上取决于您的显卡驱动程序和显示器驱动程序。继续进入Win 8后,旧的图形模式不再可用,您现在可以获得最适合您要求的模式。



在DirectX下,您可以枚举所有可用的模式全屏模式。我现在无法查找,但在XNA中应该有一些方法可以做同样的事情。



然后,为什么你需要知道确切的屏幕分辨率无论如何?硬编码的固定值永远不会很好。为什么不从当前使用的模式中获取此类信息?无论你的游戏运行在什么计算机上,它都将是正确的。
No, there must not be a way, sorry. Not every possible mode must be available. That actually is determined by your graphics card drivers and monitor drivers. After moving on to Win 8, the old graphics mode was not available anymore and you now get the closest mode fitting to your requests.

Under DirectX you can enumerate all available fullscreen modes. I can't look it up right now, but there should be some way to do the same in XNA.

Then again, why do you need to know the exact screen resolution anyway? Hardcoded fixed values will never work very well. Why don't you get such information from the currently used mode? Then it will always be correct, no matter what computer your game is running on.


这篇关于Xna全屏大小问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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