summaryrefslogtreecommitdiff
path: root/Penguloon/Controls/ControlBase.cs
diff options
context:
space:
mode:
authoraldrikboy <aldrikboy@gmail.com>2017-12-29 17:27:49 +0100
committeraldrikboy <aldrikboy@gmail.com>2017-12-29 17:27:49 +0100
commitda38e93e55b6ff46a53dcd9d2be393149089d329 (patch)
treec19fdb964ee6f8dd8dd3102b22de541828850983 /Penguloon/Controls/ControlBase.cs
parent5373e919a0d9e389fc2076963f610d044c21ccb5 (diff)
obejct info, new level selector, credits haHA
Diffstat (limited to 'Penguloon/Controls/ControlBase.cs')
-rw-r--r--Penguloon/Controls/ControlBase.cs5
1 files changed, 4 insertions, 1 deletions
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<ClickArgs> OnFingerDown;
public event EventHandler<ClickArgs> OnClick;
public event EventHandler<MoveArgs> 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));
}