Example #1
0
 public void Draw(SpriteBatch spriteBatch)
 {
     Game.GraphicsDevice.Clear(Color.Black);
     spriteBatch.Begin();
     TotemAnimator.Draw(spriteBatch);
     spriteBatch.End();
     CurrentMenu.Draw(spriteBatch);
 }
Example #2
0
        /// <summary>
        /// M_Draw
        /// </summary>
        public void Draw( )
        {
            if (CurrentMenu == null || Host.Keyboard.Destination != KeyDestination.key_menu)
            {
                return;
            }

            if (!_RecursiveDraw)
            {
                Host.Screen.CopyEverithing = true;

                if (Host.Screen.ConCurrent > 0)
                {
                    Host.DrawingContext.DrawConsoleBackground(Host.Screen.vid.height);
                    Host.Sound.ExtraUpdate();
                }
                else
                {
                    Host.DrawingContext.FadeScreen();
                }

                Host.Screen.FullUpdate = 0;
            }
            else
            {
                _RecursiveDraw = false;
            }

            CurrentMenu?.Draw();

            if (EnterSound)
            {
                Host.Sound.LocalSound("misc/menu2.wav");
                EnterSound = false;
            }

            Host.Sound.ExtraUpdate();
        }
Example #3
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Microsoft.Xna.Framework.Color.Black);

            spriteBatch.Begin();

            var cameraPosition = Player.CalculateCamera(viewport);

            Background.DrawBackground(spriteBatch, cameraPosition, viewport);

            GameWorld.Draw(spriteBatch, cameraPosition, viewport);

            Hud.Draw(spriteBatch, viewport);

            if (GameState == GameStates.Paused)
            {
                CurrentMenu.Draw(spriteBatch, cameraPosition, viewport);
            }

            spriteBatch.End();

            base.Draw(gameTime);
        }