游戏中的Metro应用举行事件 [英] Metro app Holding event in games

查看:71
本文介绍了游戏中的Metro应用举行事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我制作了一个游戏,用户在其中导航角色.由于它是为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_DownKey_Up事件)

1) using keyboard (Key_Down and Key_Up events)

2)使用触摸并按住(TappedHolding事件)

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?

推荐答案

我正在将JavaScript用于Metro应用开发,并且在这里我几乎使用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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆