diff options
| author | aldrikboy <aldrikboy@gmail.com> | 2017-12-25 14:07:42 +0100 |
|---|---|---|
| committer | aldrikboy <aldrikboy@gmail.com> | 2017-12-25 14:07:42 +0100 |
| commit | 020fd61af37eaaac81d7b930be15f8c350f28b7d (patch) | |
| tree | 213e59cc8a7b60c717a0ea05159ac8967e6f5c35 /Penguloon/Scenes/StatsScene.cs | |
| parent | 3281eed3ffca3b4488335846430b231001aea753 (diff) | |
I dab everyday
Diffstat (limited to 'Penguloon/Scenes/StatsScene.cs')
| -rw-r--r-- | Penguloon/Scenes/StatsScene.cs | 69 |
1 files changed, 69 insertions, 0 deletions
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 |
