public override void Draw(GameTime gameTime)
        {
            var batch = gameRef.spriteBatch;

            batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp,
                        DepthStencilState.Default, RasterizerState.CullNone);
            {
                batch.Draw(backgroundImage, new Rectangle(0, 0, Game1.GAME_WIDTH, Game1.GAME_HEIGHT), Color.White);
                powerUpMgr.Draw(batch);
                players.ForEach((p) =>
                {
                    p.Draw(batch, gameTime);
                });
                batch.Draw(backgroundoverlay, Vector2.Zero, WeatherManager.BgColor);
                WeatherManager.Draw(batch, gameTime);
                EffectManager.Draw(batch, gameTime);
                FadeOutRect.Draw(batch, Vector2.Zero, FadeOutColor);
            }
            batch.End();

            batch.Begin(SpriteSortMode.Deferred, BlendState.Additive);
            {
                WeatherManager.Bolts.ForEach(b => b.Draw(batch));
            }
            batch.End();
        }
        public override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);

            if (currentState == State.Playing || currentState == State.Frozen)
            {
                gameRef.GraphicsDevice.SetRenderTarget(mainTarget);
                gameRef.GraphicsDevice.Clear(Color.Transparent);
                var spriteBatch = gameRef.spriteBatch;

                spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp,
                                  DepthStencilState.Default, RasterizerState.CullNone, null, Camera.GetTransform());

                LevelManager.Draw(spriteBatch, gameTime);
                EntityManager.Draw(spriteBatch, gameTime);

                spriteBatch.End();
                gameRef.GraphicsDevice.SetRenderTarget(null);

                spriteBatch.Begin();
                spriteBatch.Draw(mainTarget, Vector2.Zero, Color.White);
                hud.Draw(gameTime, spriteBatch);

                spriteBatch.End();
            }
            else
            {
                var       spriteBatch = gameRef.spriteBatch;
                Texture2D result      = blurOverlay.PerformGaussianBlur((Texture2D)mainTarget,
                                                                        target1, target2, spriteBatch);

                spriteBatch.Begin();
                spriteBatch.Draw(result, Vector2.Zero, Color.White);
                spriteBatch.Draw(background, new Rectangle(0, 0, MainGame.GAME_WIDTH, MainGame.GAME_HEIGHT), Color.Black * .6f);
                switch (pauseState)
                {
                case State_Paused.Normal:
                    pauseControls_Normal.Draw(spriteBatch, gameTime);
                    break;

                case State_Paused.Save:
                    pauseControls_Save.Draw(spriteBatch, gameTime);
                    break;

                case State_Paused.Quit:
                    pauseControls_Quit.Draw(spriteBatch, gameTime);
                    break;

                default:
                    break;
                }

                spriteBatch.End();
            }

            gameRef.spriteBatch.Begin();
            FadeOutRect.Draw(gameRef.spriteBatch, Vector2.Zero, FadeOutColor);
            gameRef.spriteBatch.End();
        }
        public override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);

            gameRef.spriteBatch.Begin();
            FadeOutRect.Draw(gameRef.spriteBatch, Vector2.Zero, FadeOutColor);
            gameRef.spriteBatch.End();
        }
        public override void Draw(GameTime gameTime)
        {
            var spriteBatch = gameRef.spriteBatch;

            spriteBatch.Begin();
            {
                spriteBatch.Draw(titleScreen, titleRectangle, Color.White);
                buttons.ForEach(b => b.Draw(spriteBatch, gameTime));
                FadeOutRect.Draw(spriteBatch, Vector2.Zero, FadeOutColor);
            }
            spriteBatch.End();

            base.Draw(gameTime);
        }
        public override void Draw(GameTime gameTime)
        {
            var batch = gameRef.spriteBatch;

            batch.Begin();
            anim.Draw(batch, gameTime, new Rectangle(0, 0, MainGame.GAME_WIDTH, MainGame.GAME_HEIGHT));
#if DEBUG
            batch.DrawString(debugFont, "DEBUGGING -- " + MainGame.VERSION, new Vector2(MainGame.GAME_WIDTH - debugFont.MeasureString(
                                                                                            "DEBUGGING -- " + MainGame.VERSION).X - 5, MainGame.GAME_HEIGHT - debugFont.LineSpacing - 2), Color.White);
#else
            batch.DrawString(debugFont, MainGame.VERSION, new Vector2(MainGame.GAME_WIDTH - debugFont.MeasureString(
                                                                          MainGame.VERSION).X - 2, MainGame.GAME_HEIGHT - debugFont.LineSpacing - 2), Color.White);
#endif
            batch.End();

            base.Draw(gameTime);

            batch.Begin();
            {
                menuControls.Draw(batch, gameTime);

                batch.Draw(titleImage, new Vector2(MainGame.GAME_WIDTH / 2 - title.Width - 280, 70), Color.White);

                if (currentState != State.Menu)
                {
                    batch.Draw(blackOverlay, Vector2.Zero, Color.Black * 0.8f);
                }
                switch (currentState)
                {
                case State.NewGame:
                    newGameControls.Draw(batch, gameTime);
                    break;

                case State.LoadGame:
                    loadGameControls.Draw(batch, gameTime);
                    break;

                case State.Options:
                    optionsControls.Draw(batch, gameTime);
                    break;

                case State.Quit:
                    quitControls.Draw(batch, gameTime);
                    break;
                }

                FadeOutRect.Draw(batch, Vector2.Zero, FadeOutColor);
            }
            batch.End();
        }
示例#6
0
        public override void Draw(GameTime gameTime)
        {
            SpriteBatch batch = gameRef.spriteBatch;

            batch.Begin();
            batch.Draw(backgroundImage, new Rectangle(0, 0, Game1.GAME_WIDTH, Game1.GAME_HEIGHT), Color.White);
            batch.DrawString(skyFallFont, "Step one choose helo-color!", new Vector2(65, 50), Color.Black);
            batch.DrawString(skyFallFont, "Step two choose environment.", new Vector2(65, 400), Color.Black);

            foreach (Button b in buttons)
            {
                b.Draw(batch, gameTime);
            }

            batch.Draw(content.Load <Texture2D>("helicopter2"), helicopter1, player1Color);
            batch.Draw(content.Load <Texture2D>("helicopter2"), helicopter2, null, player2Color, 0f, Vector2.Zero, SpriteEffects.FlipHorizontally, 0f);
            FadeOutRect.Draw(batch, Vector2.Zero, FadeOutColor);
            batch.End();

            base.Draw(gameTime);
        }