0

I made a game where user navigates a character. Since it is designed for both PC and tablet (with Win8), there are two options how to do it.

1) using keyboard (Key_Down and Key_Up events)

2) using touch and hold (Tapped and Holding events)

Unfortunately there is a problem with Holding event, because it raises after a long time period (I think 1 sec). I had to use word long there becase it really is a long time period in games.

Now, I need a better solution. There is a onscreen joystick in the game compounded from four images that stands for arrows. How do I make player's character move immediately and continuously just by tap-and-hold on the arrow image?

Ondrej Janacek
  • 12,486
  • 14
  • 59
  • 93
  • I'am using javascript for metro app dev and there I'am using MSPointerDown/MSPointerUp for nearly the same. Maybe it is simlar in c#? Can this [link](http://msdn.microsoft.com/en-us/library/windows/apps/xaml/jj150606.aspx) help? – Jan Hommes Aug 28 '12 at 15:02
  • And can you still recognize if it was tapped or is being holded? – Ondrej Janacek Aug 28 '12 at 15:24
  • Don't know if i get your question right. But I'am using the MsPointer-eventhandler to move a usercontrol (hold and moved around). I'am using MSPointerDown to regonize the first tap, MSPointerMove to move the user-control (similar to your holding) and MSPointerUp to release the handler. [Here] (http://stackoverflow.com/questions/8673464/how-do-i-detect-multitouch-actions-in-a-windows-8-metro-app/11176986#11176986) you can find an JS example (bit messy, but it works). [Here](http://www.janhommes.de/canvascurve/) you can see pictures of my control in action. – Jan Hommes Aug 30 '12 at 06:38
  • I finally implemented events you suggested me and it works as I hoped it will. Make answer from your first comment so that I can mark it as the Answer, please. – Ondrej Janacek Sep 02 '12 at 08:22

1 Answers1

1

I'am using javascript for metro app dev and there I'am using MSPointerDown/MSPointerUp for nearly the same. Maybe it is simlar in c#? Can this link help?

Jan Hommes
  • 5,122
  • 4
  • 33
  • 45