Created
November 8, 2012 12:52
-
-
Save kenpower/4038626 to your computer and use it in GitHub Desktop.
Drawing a basic radar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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