我從Microsoft.Xna.Framework.DrawableGameComponent
獲得在DrawableGameComponent窗口大小在XNA
繼承了Avatar
對象我試圖讓窗口的尺寸在我Avatar
的overrided方法Update
。 但我沒有找到任何方法來獲得窗口的寬度和高度。
方法GraphicsDeviceManager.DefaultBackBufferHeight
迄今爲止不起作用。
我的構造函數:
public Avatar(Game game)
: base(game)
{
// TODO: Construct any child components here
}
如果您在渲染區域的大小之後,通常需要* viewport *的大小。 –