How to listen for both tap and gestures at the same time in Adobe AIR for iOS?

后端 未结 3 545
没有蜡笔的小新
没有蜡笔的小新 2021-01-07 03:56

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 Multitouc

3条回答
  •  臣服心动
    2021-01-07 04:03

    You can use standard mouse events for tap.

    This would maintain gesture multitouch input mode.

    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:

    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.

提交回复
热议问题