public void Draw(SpriteBatch spriteBatch) { if (fadeIn) { if (alpha < 1f) { alpha += 0.1f; vtForeground.Y += 4; } else { alpha = 1; switch (Type) { case UIDialogType.Confirm: btnYes.Visible = btnNo.Visible = true; break; case UIDialogType.Message: btnOk.Visible = true; break; } } } else { if (alpha > 0f) { alpha -= 0.1f; vtForeground.Y -= 4; } else { alpha = 0; Visible = false; } } spriteBatch.Draw(texBackground, Vector2.Zero, Color.Black * alpha * 0.6f); spriteBatch.Draw(texForeground[Type], vtForeground, Color.White * alpha); int titleY = (int)vtForeground.Y + 14; int titleX = 400 - (int)Main.FontLarge.MeasureString(Title).X / 2; spriteBatch.DrawString(Main.FontLarge, Title, new Vector2(titleX, titleY), Color.Black * alpha); spriteBatch.DrawString(Main.FontSmall, Content, new Vector2(vtForeground.X + CONTENT_MARGIN_LEFT, vtForeground.Y + 72), Color.Black * alpha); switch (Type) { case UIDialogType.Confirm: btnYes.Draw(spriteBatch); btnNo.Draw(spriteBatch); break; case UIDialogType.Message: btnOk.Draw(spriteBatch); break; } }
public override void Draw(SpriteBatch spriteBatch) { switch (State) { case LeaderboardState.Fill: spriteBatch.Draw(texLeaderboardSubmit, Vector2.Zero, Color.White); spriteBatch.DrawString(Main.FontLarge, _username, vtUsername, Color.White); spriteBatch.DrawString(Main.FontLarge, _score.ToString(), vtScore, Color.White); btnSubmit.Draw(spriteBatch); break; case LeaderboardState.Submit: spriteBatch.Draw(texLeaderboardSubmit, Vector2.Zero, Color.White); spriteBatch.DrawString(Main.FontLarge, _username, vtUsername, Color.White); spriteBatch.DrawString(Main.FontLarge, _score.ToString(), vtScore, Color.White); spriteBatch.Draw(texWhiteScreen, Vector2.Zero, Color.Black * 0.8f); if (tick < 2) { tick++; } else { tick = 0; sprLoading.NextFrame(); } sprLoading.Draw(spriteBatch); spriteBatch.DrawString(Main.FontNormal, Localize.Instance.SubmittingData, vtSubmiting, Color.White); break; case LeaderboardState.View: spriteBatch.Draw(texLeaderboardBackground, vtBackground, Color.White); spriteBatch.DrawString(Main.FontSmall, strView7.ToString(), vtView7, Color.White); spriteBatch.DrawString(Main.FontSmall, strViewAll, vtViewAll, Color.White); spriteBatch.Draw(texLeaderboardForeground, Vector2.Zero, Color.White); spriteBatch.DrawString(Main.FontSmall, strRank, vtRank, Color.White); break; } if (uiDialog.Visible) { uiDialog.Draw(spriteBatch); } }
public void Draw(SpriteBatch spriteBatch) { if (_state == QuickMenuState.Hide) { return; } spriteBatch.Draw(texBackground, Vector2.Zero, Color.Black * _backgroundAlpha); spriteBatch.Draw(texMenu, vtMenu, Color.White); SoundController.GetInstance().Draw(spriteBatch, recMusic, recSound); if (_state == QuickMenuState.Show) { btnReset.Draw(spriteBatch); btnSolution.Draw(spriteBatch); btnAbandon.Draw(spriteBatch); btnMain.Draw(spriteBatch); } if (confirmDialog.Visible) { confirmDialog.Draw(spriteBatch); } }
public void Draw(SpriteBatch spriteBatch) { button.Draw(spriteBatch); }