From fd6fa4e5cebbe3edb65d50c78dcc8a97ce98ce64 Mon Sep 17 00:00:00 2001 From: aldrikboy Date: Mon, 11 Dec 2017 22:02:13 +0100 Subject: First commit --- Penguloon/Controls/Button.cs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Penguloon/Controls/Button.cs (limited to 'Penguloon/Controls/Button.cs') diff --git a/Penguloon/Controls/Button.cs b/Penguloon/Controls/Button.cs new file mode 100644 index 0000000..121321c --- /dev/null +++ b/Penguloon/Controls/Button.cs @@ -0,0 +1,28 @@ +using Microsoft.Xna.Framework; +using Penguloon.Scenes; + +namespace Penguloon.Controls +{ + class Button : ControlBase + { + public Button(SceneBase parentScene, Vector2 position, Vector2 size, string text) : base(parentScene, position, size) + { + this.BackgroundIdle = ContentManager.GetTexture("UI/btnIdle"); + this.BackgroundPressed = ContentManager.GetTexture("UI/btnPressed"); + this.BackgroundDisabled = ContentManager.GetTexture("UI/btnDisabled"); + this.Text = text; + + this.ForeColor = Color.Gray; + this.BorderColor = Color.Gray; + this.BorderWidth = 0; + this.Font = ContentManager.GetFont(StaticUIValues.MenuFont); + + OnClick += Button_OnClick; + } + + private void Button_OnClick(object sender, ClickArgs e) + { + SoundManager.PlayClickSound(); + } + } +} \ No newline at end of file -- cgit v1.2.3-70-g09d2