Using touch events with Createjs / Easeljs

13,344

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.

Share:
13,344
Cod1ngFree
Author by

Cod1ngFree

Firefox Marketplace Reviewer!

Updated on June 09, 2022

Comments

  • Cod1ngFree
    Cod1ngFree almost 2 years

    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.