From da38e93e55b6ff46a53dcd9d2be393149089d329 Mon Sep 17 00:00:00 2001 From: aldrikboy Date: Fri, 29 Dec 2017 17:27:49 +0100 Subject: obejct info, new level selector, credits haHA --- Penguloon/Controls/ControlBase.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Penguloon/Controls/ControlBase.cs') diff --git a/Penguloon/Controls/ControlBase.cs b/Penguloon/Controls/ControlBase.cs index b6b7a57..bbd3a14 100644 --- a/Penguloon/Controls/ControlBase.cs +++ b/Penguloon/Controls/ControlBase.cs @@ -25,6 +25,7 @@ namespace Penguloon.Controls public Texture2D BackgroundDisabled { get; set; } public event EventHandler OnMissClick; + public event EventHandler OnFingerDown; public event EventHandler OnClick; public event EventHandler OnMove; @@ -92,7 +93,7 @@ namespace Penguloon.Controls if (touchRec.Intersects(controlRec)) { - if (touchLocations[i].State == TouchLocationState.Released) + if (touchLocations[i].State == TouchLocationState.Released && this.ControlState == ControlState.Pressed) { this.ControlState = ControlState.Idle; OnClick?.Invoke(this, new ClickArgs(touchLocations[i].Position)); @@ -101,10 +102,12 @@ namespace Penguloon.Controls if (touchLocations[i].State == TouchLocationState.Pressed) { this.ControlState = ControlState.Pressed; + OnFingerDown?.Invoke(this, new ClickArgs(touchLocations[i].Position)); } if (touchLocations[i].State == TouchLocationState.Moved) { + OnFingerDown?.Invoke(this, new ClickArgs(touchLocations[i].Position)); touchLocations[i].TryGetPreviousLocation(out TouchLocation touch); OnMove?.Invoke(this, new MoveArgs(touchLocations[i].Position, touch.Position)); } -- cgit v1.2.3-70-g09d2