Metro app Holding event in games

怎甘沉沦 提交于 2019-12-25 05:28:29

问题


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?


回答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?



来源:https://stackoverflow.com/questions/12159855/metro-app-holding-event-in-games

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!