private void DrawHud()
{
Rectangle titleSafeArea = GraphicsDevice.Viewport.TitleSafeArea;
Vector2 hudLocation = new Vector2(titleSafeArea.X, titleSafeArea.Y);
Vector2 center = new Vector2(titleSafeArea.X + titleSafeArea.Width / 2.0f,
titleSafeArea.Y + titleSafeArea.Height / 2.0f);
// Draw time remaining. Uses modulo division to cause blinking when the
// player is running out of time.
/*
string timeString = "TIME: " + level.TimeRemaining.Minutes.ToString("00") + ":" + level.TimeRemaining.Seconds.ToString("00");
Color timeColor;
if (level.TimeRemaining > WarningTime ||
level.ReachedExit ||
(int)level.TimeRemaining.TotalSeconds % 2 == 0)
{
timeColor = Color.Yellow;
}
else
{
timeColor = Color.Red;
}
*/
DrawShadowedString(hudFont, map.Level.Name, hudLocation, Color.Yellow);
// Draw score
/*
float timeHeight = hudFont.MeasureString(timeString).Y;
DrawShadowedString(hudFont, "SCORE: " + level.Score.ToString(), hudLocation + new Vector2(0.0f, timeHeight * 1.2f), Color.Yellow);
*/
// Determine the status overlay message to show.
Texture2D status = null;
/**
if (level.TimeRemaining == TimeSpan.Zero)
{
if (level.ReachedExit)
{
status = winOverlay;
}
else
{
status = loseOverlay;
}
}
else */
if (!map.Player.IsAlive)
{
//status = diedOverlay;
}
if (status != null)
{
// Draw status message.
Vector2 statusSize = new Vector2(status.Width, status.Height);
spriteBatch.Draw(status, center - statusSize / 2, Color.White);
}
}