开发者

MouseEvents or TouchEvents, any difference in execution speed?

开发者 https://www.devze.com 2023-04-04 20:36 出处:网络
I\'m building an air app which will run on iPads. For the touch interaction I\'m using just MouseEvents handlers (MOUSE_DOWN, MOUSE_MOVE, MOUSE_OUT, MOUSE_UP) because my app don\'t need multitouch开发

I'm building an air app which will run on iPads. For the touch interaction I'm using just MouseEvents handlers (MOUSE_DOWN, MOUSE_MOVE, MOUSE_OUT, MOUSE_UP) because my app don't need multitouch开发者_开发百科, now I'm wondering if there is any difference in execution speed, should I use the equivalent touch events or the mouse events are faster?


MouseEvents will be faster and easier since you don't have to write extra logic to ignore secondary touches.

For performance, the most important thing to do is set mouseEnabled = false and mouseChildren = false wherever you can. Otherwise Flash will be checking every DisplayObject for mouse events, and dragging your finger across the screen will cause a drop in frame rate.


There should be no performance difference.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号