CreateJS / EaselJS

The Easel Javascript library provides a full, hierarchical display list, a core interaction model, and helper classes to make working with the HTML5 Canvas element much easier.
http://createjs.com/
MIT License
8.14k stars 1.97k forks source link

Cannot use touchmove #846

Open easilyBaffled opened 7 years ago

easilyBaffled commented 7 years ago

I am working on a project that needs to work both in desktop and mobile browsers. Part of the interaction is that you create a path of nodes by pressing on one to start then dragging to others to add them to the path. I am using

node.on( ('ontouchmove' in window) ? 'touchmove' : 'mouseover', e => {
                    console.log('MOVING');
                    e.preventDefault();
                    if ( pathBuilding )  {
                        if ( !path.includes( [ node.x, node.y ] ) ) {
                            path.push( [ node.x, node.y ] );
                            node.setState( { selected: true } );
                        }
                    }
                } );

To handle the second part where you add subsequent nodes to the path. This works on on the desktop, but nothing is triggered on iOS Safari or iOS Chrome.

I have set createjs.Touch.enable(stage); stage.enableMouseOver(20); and my mousedown and touchend work. I have seen rollover in a few places, but that hasn't helped, and I know there is a pressmove but that would only contain the information about the node I pressed on, and not the ones I am moving over.

lannymcnie commented 7 years ago

I added a comment to your StackOverflow post.

Do you have an online sample somewhere?