pozadi
opakování pozadí
private void DrawBackground()
{
for (int x = 0; x < graphics.PreferredBackBufferWidth; x += background.Width)
for (int y = 0; y < graphics.PreferredBackBufferHeight; y += background.Height)
{
spriteBatch.Draw(background, new Rectangle(x, y, background.Width, background.Height), Color.White);
}
}
nebo na celé okno obrázek přizbusobit
public override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
game1.spriteBatch.Begin();
game1.spriteBatch.Draw(backGround, Vector2.Zero, Color.White);
game1.spriteBatch.End();
base.Draw(gameTime);
}