Esempio n. 1
0
 /// <summary>
 /// Draws the current screen.
 /// </summary>
 public void OnEarlyDraw(GameTime gameTime)
 {
     if (_executingScreenTransition)
     {
         _currentTransition.Draw();
     }
     else
     {
         CurrentScreen?.OnEarlyDraw(gameTime);
         foreach (var overlay in _activeOverlays)
         {
             overlay.OnEarlyDraw(gameTime);
         }
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Draw the ScreenManager content.
        /// </summary>
        /// <param name="spriteBatch">The SpriteBatch to draw to</param>
        public void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Begin();

            if (currentScreen != null)
            {
                currentScreen.Draw(spriteBatch);
            }

            if (transition != null)
            {
                if (transition.IsActive)
                {
                    transition.Draw(GraphicsDevice, spriteBatch);
                }
            }

            spriteBatch.End();
        }