Using touch events with Createjs / Easeljs

I am trying to use touch events with Createjs / Easeljs objects. For example, I am trying to hook up the touchstart and touchmove event using addEventListener.

Touchstart and mousedown seem to work: I use a browser and touch device for testing, and it seems to work in both cases.

However, mousemove and touchmove do not seem to work. I, although it was because I deleted the stopPropagation and preventDefault methods, but I saw that Lanny McNie wrote that there was no need to do this in CreateJS 1 .

I can’t understand why this is not working.

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

Sincerely.

+6
source share
1 answer

You can use the Touch class included with EaselJS to enable multi-touch, which translates to regular Muselown / mousemove events. Check out the DragAndDrop demo: http://www.createjs.com/demos/easeljs/draganddrop

createjs.Touch.enable(stage); 

Greetings.

+11
source

Source: https://habr.com/ru/post/947541/


All Articles