Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using touch events with Createjs / Easeljs

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.

like image 665
Cod1ngFree Avatar asked Jun 18 '13 10:06

Cod1ngFree


1 Answers

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.

like image 104
Lanny Avatar answered Oct 20 '22 18:10

Lanny