Using touch events with Createjs / Easeljs

此生再无相见时 提交于 2019-11-29 03:38:13

问题


I'm trying to use touch events with Createjs / Easeljs objects. For example, I'm trying to attach a touchstart and touchmove event using addEventListener.

Touchstart and mousedown seems to work: I'm using a browser and a touch device to test it and it seems to work in both cases.

However, mousemove and touchmove doesn't seem to work. I though it was because I removed the stopPropagation and preventDefault methods, but I saw that Lanny McNie wrote that there is no need to do it in CreateJS 1.

I can't figure out why it doesn't work.

This is my code: http://pastebin.com/pqxWLNKG

Regards.


回答1:


You can use the Touch class included with EaselJS to enable multi-touch - which translate into normal EaselJS mousedown/mousemove events. Check out the DragAndDrop demo: http://www.createjs.com/demos/easeljs/draganddrop

createjs.Touch.enable(stage);

Cheers.



来源:https://stackoverflow.com/questions/17166619/using-touch-events-with-createjs-easeljs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!