Example #1
0
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.Black);

            // TODO: Add your drawing code here
            spriteBatch.Begin();
            //Depth Level 0:
            spriteBatch.Draw(galaxyBackground, new Rectangle(0, 0, GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height), Color.White);

            //Depth Level 1:
            spriteBatch.Draw(galaxyStars, new Rectangle(-backgroundPadding + (int)(offset.X / (backgroundPadding / 10)), -backgroundPadding + (int)(offset.Y / (backgroundPadding / 10)), GraphicsDevice.Viewport.Width + (backgroundPadding * 2), GraphicsDevice.Viewport.Height + (backgroundPadding * 2)), Color.White);

            //Depth Level 2:
            spriteBatch.Draw(asteroidTexture, new Rectangle((GraphicsDevice.Viewport.Width / 2) - (asteroidSize / 2) + (int)offset.X, (GraphicsDevice.Viewport.Height / 2) - (asteroidSize / 2) + (int)offset.Y, asteroidSize, asteroidSize), Color.White);
            Tile.drawTiles(spriteBatch);
            Tile.setTileOverlay(Mouse.GetState(), spriteBatch);

            spriteBatch.Draw(Player.shipTexture[Player.imageID], new Rectangle(GraphicsDevice.Viewport.Width / 2, GraphicsDevice.Viewport.Height / 2, Player.size[0], Player.size[1]), null, Color.White, Player.rotation, new Vector2(110, 269), SpriteEffects.None, 0F);

            Projectile.drawProjectiles(spriteBatch);
            Enemy.drawEnemies(spriteBatch);

            ActiveKeyframeEffect.drawKeyframeEffects(spriteBatch);

            GUI.drawGold(spriteBatch, displayFont);
            GUI.drawButtons(spriteBatch);
            Minimap.drawMinimap(spriteBatch);

            if (GUI.paused)
            {
                spriteBatch.Draw(GUI.pausedOverlay, screenBounds, Color.White);
            }
            handleRepairModeDraw(spriteBatch);

            spriteBatch.End();
            base.Draw(gameTime);
        }