Skip to content

Instantly share code, notes, and snippets.

@kenpower
Created November 8, 2012 12:52
Show Gist options
  • Select an option

  • Save kenpower/4038626 to your computer and use it in GitHub Desktop.

Select an option

Save kenpower/4038626 to your computer and use it in GitHub Desktop.
Drawing a basic radar
Matrix radarTrans = Matrix.CreateScale(0.04f);
Matrix radarScreenTrans = Matrix.CreateScale(0.3f);
//draw radar background
spriteBatch.Begin(SpriteSortMode.Immediate, null, null, null, null, null, radarScreenTrans);
spriteBatch.Draw(radar, Vector2.Zero, Color.White);
spriteBatch.End();
//draw world entities
spriteBatch.Begin(SpriteSortMode.Immediate, null, null, null, null, null, radarTrans);
foreach (Sprite s in sprites)
s.Draw(gameTime, spriteBatch, true);
spriteBatch.End();
//draw radar mask
spriteBatch.Begin(SpriteSortMode.Immediate, null, null, null, null, null, radarScreenTrans);
spriteBatch.Draw(radar_mask, Vector2.Zero, Color.White);
spriteBatch.End();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment