Home   Notes   Contact Me

XNA

Local

External


Background

A good size to make the background is 1280x720 (720p size), and let is scale. Or maybe make multiple images of the right sizes.

Texture2D backgroundTexture; Rectangle screenSize; // LoadContent() backgroundTexture = content.Load<Texture2D>("resourceId"); screenSize = new Rectangle(0, 0, graphics.GraphicsDevice.DisplayMode.Width, graphics.GraphicsDevice.DisplayMode.Height); // or maybe... screenSize = new Rectangle(0, 0, graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight); // Draw(): spriteBatch.Begin(); spriteBatch.Draw(backgroundTexture, screenSize, Color.White); spriteBatch.End();