How long has the player tapped on the iOS/Android display screen? How can I measure the time?
In my game the player needs to tap on the iOS/Android display screen to make a gameplay action. I want to find out how long the player pressed his finger against the display screen. For example, if the player pressed his finger 1 second on the screen than I could make a different or stronger action when the tap gesture is finished. I thought maybe I could multiply the time of the tap gesture with another value to determine the strength of a gameplay action in my game.
For example: Strength of gameplay action = xx seconds * 1000
But I don´t know how to measure the time that the finger was on the screen. How can I measure the time of the tap gesture?
TouchPanel.EnabledGestures = GestureType.Tap | GestureType.FreeDrag | GestureType.DragComplete;
while (TouchPanel.IsGestureAvailable)
{
GestureSample gs = TouchPanel.ReadGesture();
switch (gs.GestureType)
{
case GestureType.Tap:
// Strength of gameplay action = xx seconds * 1000 ?
break;
case GestureType.FreeDrag:
break;
case GestureType.DragComplete:
break;
}
}