I have an Avatar object inherited from Microsoft.Xna.Framework.DrawableGameComponent
I try to get the window’s dimension in the overrided method Update of my Avatar.
But i don’t find any methods to get the width and the height of the window.
the method GraphicsDeviceManager.DefaultBackBufferHeight doesn’t work so far.
my constructor :
public Avatar(Game game)
: base(game)
{
// TODO: Construct any child components here
}
Try
game.Windowfor the Window. TheGameWindowclass has theClientBoundsmember you are looking for.