using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Input.Touch; using Penguloon.Controls; namespace Penguloon.Scenes { class StatsScene : SceneBase { public StatsScene(Main main) : base(main) { } public override void CreateControls() { Button btnBack = new Button(this, new Vector2(50, 50), StaticUIValues.MenuButtonSize, Main.Resources.GetString(Resource.String.LevelSelectionBack)); btnBack.OnClick += BtnStart_OnClick; Controls.Add(btnBack); } private void BtnStart_OnClick(object sender, ClickArgs e) { SceneManager.SelectedScene = SelectedScene.Menu; } public override void Draw(float deltaTime) { // background Main.SpriteBatch.Draw(ContentManager.GetTexture("UI/background"), destinationRectangle: new Rectangle(0, 0, (int)StaticUIValues.ScreenViewport.X, (int)StaticUIValues.ScreenViewport.Y)); DrawSnowflakes(); int borderHorizontalY = 50 + (int)StaticUIValues.MenuButtonSize.Y + 50; //border top Main.SpriteBatch.Draw(ContentManager.GetTexture("UI/border-horizontal"), destinationRectangle: new Rectangle(50, borderHorizontalY - 7, StaticUIValues.BorderWidth * 2, StaticUIValues.BorderWidth * 2)); //border bottom Main.SpriteBatch.Draw(ContentManager.GetTexture("UI/border-horizontal"), destinationRectangle: new Rectangle(50, (int)StaticUIValues.ScreenViewport.Y - 50 - (StaticUIValues.BorderWidth * 2) + 7, StaticUIValues.BorderWidth * 2, StaticUIValues.BorderWidth * 2)); //border vertical Main.SpriteBatch.Draw(ContentManager.GetTexture("UI/border"), destinationRectangle: new Rectangle(50, borderHorizontalY, StaticUIValues.BorderWidth * 2, (int)StaticUIValues.ScreenViewport.Y - (borderHorizontalY) - 50)); DrawStats(borderHorizontalY); base.Draw(deltaTime); } private void DrawStats(int borderHorizontalY) { DrawText(ContentManager.GetFont(StaticUIValues.StatsFont), Main.Resources.GetString(Resource.String.StatsTotalStatsTitle), new Vector2(120, borderHorizontalY), new Vector2(0, 0), TextAllignment.LeftTop, Color.FromNonPremultiplied(200, 200, 200, 200), Color.Black, 2); int martinXRight = StaticUIValues.StatsMarginXRight; // Total kills DrawText(ContentManager.GetFont(StaticUIValues.StatsFont), Main.Resources.GetString(Resource.String.StatsTotalKills), new Vector2(120, borderHorizontalY + 25 + (StaticUIValues.StatsSpacingY * 1)), new Vector2(0, 0), TextAllignment.LeftTop, Color.White, Color.Black, 2); // Total kills stat DrawText(ContentManager.GetFont(StaticUIValues.StatsFont), UserdataManager.TotalKills.ToString(), new Vector2(StaticUIValues.ScreenViewport.X - martinXRight, borderHorizontalY + 25 + (StaticUIValues.StatsSpacingY * 1)), new Vector2(0, 0), TextAllignment.RightTop, Color.White, Color.Black, 2); // Total games DrawText(ContentManager.GetFont(StaticUIValues.StatsFont), Main.Resources.GetString(Resource.String.StatsTotalGames), new Vector2(120, borderHorizontalY + 25 + (StaticUIValues.StatsSpacingY * 2)), new Vector2(0, 0), TextAllignment.LeftTop, Color.White, Color.Black, 2); // Total games stat DrawText(ContentManager.GetFont(StaticUIValues.StatsFont), UserdataManager.GamesPlayed.ToString(), new Vector2(StaticUIValues.ScreenViewport.X - martinXRight, borderHorizontalY + 25 + (StaticUIValues.StatsSpacingY * 2)), new Vector2(0, 0), TextAllignment.RightTop, Color.White, Color.Black, 2); // Total money spent DrawText(ContentManager.GetFont(StaticUIValues.StatsFont), Main.Resources.GetString(Resource.String.StatsTotalMoneySpent), new Vector2(120, borderHorizontalY + 25 + (StaticUIValues.StatsSpacingY * 3)), new Vector2(0, 0), TextAllignment.LeftTop, Color.White, Color.Black, 2); // Total money spent stat DrawText(ContentManager.GetFont(StaticUIValues.StatsFont), UserdataManager.TotalMoneySpent.ToString(), new Vector2(StaticUIValues.ScreenViewport.X - martinXRight, borderHorizontalY + 25 + (StaticUIValues.StatsSpacingY * 3)), new Vector2(0, 0), TextAllignment.RightTop, Color.White, Color.Black, 2); /////////////////// DrawText(ContentManager.GetFont(StaticUIValues.StatsFont), Main.Resources.GetString(Resource.String.StatsBestStatsTitle), new Vector2(120, borderHorizontalY + 50 + (StaticUIValues.StatsSpacingY * 4)), new Vector2(0, 0), TextAllignment.LeftTop, Color.FromNonPremultiplied(200, 200, 200, 200), Color.Black, 2); // Total kills DrawText(ContentManager.GetFont(StaticUIValues.StatsFont), Main.Resources.GetString(Resource.String.StatsBestKills), new Vector2(120, borderHorizontalY + 75 + (StaticUIValues.StatsSpacingY * 5)), new Vector2(0, 0), TextAllignment.LeftTop, Color.White, Color.Black, 2); // Total kills stat DrawText(ContentManager.GetFont(StaticUIValues.StatsFont), UserdataManager.HighestKills.ToString(), new Vector2(StaticUIValues.ScreenViewport.X - martinXRight, borderHorizontalY + 75 + (StaticUIValues.StatsSpacingY * 5)), new Vector2(0, 0), TextAllignment.RightTop, Color.White, Color.Black, 2); // Total games DrawText(ContentManager.GetFont(StaticUIValues.StatsFont), Main.Resources.GetString(Resource.String.StatsBestRound), new Vector2(120, borderHorizontalY + 75 + (StaticUIValues.StatsSpacingY * 6)), new Vector2(0, 0), TextAllignment.LeftTop, Color.White, Color.Black, 2); // Total games stat DrawText(ContentManager.GetFont(StaticUIValues.StatsFont), UserdataManager.HighestRound.ToString(), new Vector2(StaticUIValues.ScreenViewport.X - martinXRight, borderHorizontalY + 75 + (StaticUIValues.StatsSpacingY * 6)), new Vector2(0, 0), TextAllignment.RightTop, Color.White, Color.Black, 2); } } }