Metro 应用程序在游戏中举行活动 [英] Metro app Holding event in games
问题描述
我制作了一个游戏,用户可以在其中导航角色.由于它是为 PC 和平板电脑(使用 Win8)设计的,因此有两种方法可以做到.
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) 使用键盘(Key_Down
和 Key_Up
事件)
1) using keyboard (Key_Down
and Key_Up
events)
2) 使用触摸和保持(Tapped
和 Holding
事件)
2) using touch and hold (Tapped
and Holding
events)
不幸的是,Holding
事件存在问题,因为它会在 很长时间 时间段(我认为是 1 秒)后引发.我不得不使用long这个词,因为它在游戏中确实是一个很长的时间段.
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?
推荐答案
我在 Metro 应用程序开发中使用 javascript,在那里我使用 MSPointerDown/MSPointerUp 几乎相同.也许它在 c# 中很相似?这个链接有帮助吗?
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?
这篇关于Metro 应用程序在游戏中举行活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!