Skip to main content
added 97 characters in body
Source Link
House
  • 73.3k
  • 17
  • 185
  • 273

The best way to do this would be to use the GameWindow classGameWindow class found in Window member of your Game class.

Vector2 ScreenCenter = new Vector2(
    Game1.Window.ClientBounds.Width / 2, 
    Game1.Window.ClientBounds.Height / 2);

That should get you the center point for the SpriteBatch object.

The best way to do this would be to use the GameWindow class found in Window member of your Game class.

Vector2 ScreenCenter = new Vector2(
    Game1.Window.ClientBounds.Width / 2, 
    Game1.Window.ClientBounds.Height / 2);

That should get you the center point for the SpriteBatch object.

The best way to do this would be to use the GameWindow class found in Window member of your Game class.

Vector2 ScreenCenter = new Vector2(
    Game1.Window.ClientBounds.Width / 2, 
    Game1.Window.ClientBounds.Height / 2);

That should get you the center point for the SpriteBatch object.

Source Link

The best way to do this would be to use the GameWindow class found in Window member of your Game class.

Vector2 ScreenCenter = new Vector2(
    Game1.Window.ClientBounds.Width / 2, 
    Game1.Window.ClientBounds.Height / 2);

That should get you the center point for the SpriteBatch object.