【发布时间】:2010-11-25 12:56:20
【问题描述】:
如何在 XNA 中获取整个屏幕的宽度和高度?
【问题讨论】:
标签: xna fullscreen
如何在 XNA 中获取整个屏幕的宽度和高度?
【问题讨论】:
标签: xna fullscreen
GraphicsDevice.Viewport.Bounds - 这将返回 Rectangle2D 并具有参数 Width 和 Height。
【讨论】:
根据经验,我发现在 XNA 4.0 中我需要使用
GraphicsDevice.Viewport.Width
GraphicsDevice.Viewport.Height
当我发现运行窗口模式时
GraphicsDevice.DisplayMode.Width
GraphicsDevice.DisplayMode.Height
给我整个屏幕的分辨率。
希望这对其他人有所帮助。
【讨论】:
这似乎是它(我自己在谷歌上搜索了“xna 屏幕宽度高度”):
GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height
GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width
【讨论】: