From 020fd61af37eaaac81d7b930be15f8c350f28b7d Mon Sep 17 00:00:00 2001 From: aldrikboy Date: Mon, 25 Dec 2017 14:07:42 +0100 Subject: I dab everyday --- Penguloon/Scenes/StatsScene.cs | 69 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 Penguloon/Scenes/StatsScene.cs (limited to 'Penguloon/Scenes/StatsScene.cs') diff --git a/Penguloon/Scenes/StatsScene.cs b/Penguloon/Scenes/StatsScene.cs new file mode 100644 index 0000000..21adf27 --- /dev/null +++ b/Penguloon/Scenes/StatsScene.cs @@ -0,0 +1,69 @@ +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(10, 10), + 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 = 10 + (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.MenuFont), UserdataManager.TotalKills.ToString(), + new Vector2(120, borderHorizontalY), + new Vector2(0, 0), + TextAllignment.LeftTop, Color.White, Color.Black, 2); + } + } +} \ No newline at end of file -- cgit v1.2.3-70-g09d2