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.GetScreens().Length == 1)) {
otherScreensAreGone = true;
}
SpriteBatch spriteBatch = ScreenManager.SpriteBatch;
// Draw the text.
spriteBatch.Begin();
spriteBatch.GraphicsDevice.Clear(Color.Black);
// 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 (loadingIsSlow) {
SpriteFont font = ScreenManager.BigFont;
const string message = "Loading...";
// Center the text in the viewport.
Viewport viewport = ScreenManager.GraphicsDevice.Viewport;
Vector2 viewportSize = new Vector2(viewport.Width, viewport.Height);
Vector2 textSize = font.MeasureString(message);
Vector2 textPosition = viewportSize - textSize - new Vector2(30, 30);
//(viewportSize - textSize) / 2;
//Color color = TransitionWhite;
//spriteBatch.Draw(gradient, new Rectangle((int)((viewport.Width + gradient.Width) * transition)
//- gradient.Width, 0, gradient.Width, viewport.Height), Color.CornflowerBlue);
spriteBatch.DrawString(font, message, textPosition, TransitionWhite);
spriteBatch.DrawString(font, Message, new Vector2(30, 30), TransitionWhite, 0, Vector2.Zero
, 2f, SpriteEffects.None, 0);
//spriteBatch.DrawString(font, (int)(progress * 100) + "%",
//textPosition + new Vector2(0, 50), color);
}
spriteBatch.End();
}