English 中文(简体)
XNA: 接受检查
原标题:XNA: get screen s width and height
  • 时间:2009-09-04 06:22:44
  •  标签:

如何在XNA获得整个屏幕的宽度和高度?

最佳回答

这似乎就是这样(以“xna 屏幕宽度”为理由):

GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height
GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width
问题回答

经验I ve发现,在XNA 4.0中,我需要使用。

GraphicsDevice.Viewport.Width
GraphicsDevice.Viewport.Height

当我发现有窗户时

GraphicsDevice.DisplayMode.Width
GraphicsDevice.DisplayMode.Height 

让我谈一下整个屏幕。

希望这有助于其他人。

图象Device.Viewport.Bounds——这一回报是Retangle2D的,其参数是Width和Height。





相关问题
热门标签