/// <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); } } }
/// <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(); }