如何在 Adob​​e AIR for iOS 中同时监听点击和手势? [英] How to listen for both tap and gestures at the same time in Adobe AIR for iOS?

查看:27
本文介绍了如何在 Adob​​e AIR for iOS 中同时监听点击和手势?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个 iOS 游戏,我需要同时检测简单的点击和手势(滑动等).在 AIR 中,我只能看到多点触控输入模式的一种设置:TOUCH_POINT(适用于基本敲击)和 GESTURE.但是我同时需要两者,因此不能选择更改模式.我怎样才能同时收听两者?

I am making an iOS game and I need a detection for both simple tapping and gestures (swipe etc) simultaneously. In AIR, I can only see one setting for the Multitouch input mode: TOUCH_POINT (which works for basic tapping) and GESTURE. But I need both at the same time so changing the mode isn't an option. How can I listen to both at the same time?

谢谢,可以.

推荐答案

您可以使用标准鼠标事件进行点击.

You can use standard mouse events for tap.

这将保持手势多点触控输入模式.

This would maintain gesture multitouch input mode.

否则,GitHub 上的 Gestouch 框架:用于鼠标、触摸和多点触控 AS3 开发的 NUI 手势检测框架感兴趣.

Otherwise, Gestouch framework: NUI gestures detection framework for mouse, touch and multitouch AS3 development at GitHub might be of interest.

另请注意性能影响触摸/手势事件模型:

Also note performance impacts of touch / gesture event model:

触摸和手势输入都可以是多点触摸输入,具体取决于用户的设备.ActionScript 提供了处理触摸事件的 API,手势事件,以及单独跟踪的多点触控触摸事件输入.

Both touch and gesture input can be multitouch input depending on the user’s device. ActionScript provides API for handling touch events, gesture events, and individually tracked touch events for multitouch input.

注意:监听触摸和手势事件会消耗大量处理资源量(相当于渲染几帧每秒),具体取决于计算设备和操作系统.当您实际上不需要时,使用鼠标事件通常会更好触摸或手势提供的额外功能.当你使用触摸或手势事件,考虑减少图形量可能发生的更改,尤其是当可以调度此类事件时快速,如在平移、旋转或缩放操作期间.例如,你可以在用户调整组件大小时停止组件内的动画使用缩放手势.

Note: Listening for touch and gesture events can consume a significant amount of processing resources (equivalent to rendering several frames per second), depending on the computing device and operating system. It is often better to use mouse events when you do not actually need the extra functionality provided by touch or gestures. When you do use touch or gesture events, consider reducing the amount of graphical changes that can occur, especially when such events can be dispatched rapidly, as during a pan, rotate, or zoom operation. For example, you could stop animation within a component while the user resizes it using a zoom gesture.

这篇关于如何在 Adob​​e AIR for iOS 中同时监听点击和手势?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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