private void DrawPausedMessage(ISpriteBatch spriteBatch) { this._green = (this._green + 1) % 512; var greenComponent = Math.Abs(255 - this._green); const string paused = "-> P A U S E D <-"; spriteBatch.DrawCentredString(this._statusFont, paused, 100, new Color(0, greenComponent, 0)); }
/// <summary> /// Draws the loading screen. /// </summary> public override void Draw(GameTime gameTime) { // If we are the only active screen, that means all the previous screens // must have finished transitioning off. We check for this in the Draw // method, rather than in Update, because it isn't enough just for the // screens to be gone: in order for the transition to look good we must // have actually drawn a frame without them before we perform the load. if (ScreenState == ScreenState.Active && ScreenManager.Screens.Count() == 1) { this._otherScreensAreGone = true; } // The gameplay screen takes a while to load, so we display a loading // message while that is going on, but the menus load very quickly, and // it would look silly if we flashed this up for just a fraction of a // second while returning from the game to the menus. This parameter // tells us how long the loading is going to take, so we know whether // to bother drawing the message. if (this._loadingIsSlow) { ISpriteBatch spriteBatch = this.ScreenManager.SpriteBatch; SpriteFont font = ScreenManager.Font; const string message = "Loading..."; Viewport viewport = ScreenManager.GraphicsDevice.Viewport; int y = viewport.Height / 3; Color color = Color.White * TransitionAlpha; // Draw the text. spriteBatch.Begin(); spriteBatch.DrawCentredString(font, message, y, color); if (this._loadingMessage != null) { spriteBatch.DrawCentredString(font, this._loadingMessage, y + 75, color); } spriteBatch.End(); } }