Copy link to clipboard
Copied
Hello))
I know that I have already asked something similar, but I was so tormented, but could not solve this problem.
And so, the touch for dragging an object still does not work for me. Doesn't work in sensor emulation in the browser, not on a real device))
I have already written - createjs.Touch.enable(stage) - Help) ;
But unsuccessfully(((
Help me understand my mistake, please)
var stage = new createjs.Stage("canvasId");
createjs.Touch.enable(stage);
var root = this;
this.ball.on("pressmove", moveBall );
function moveBall(e) {
console.log ("pressmove") ;
var p = stage.globalToLocal(e.stageX, e.stageY)
e.currentTarget.x= p.x;
e.currentTarget.y= p.y;
}
this.ball.on("pressup", dropBall);
function dropBall () {
console.log ("pressup");
root.ball.alpha=0.5;
}
delete that top line of code.
Copy link to clipboard
Copied
delete that top line of code.
Copy link to clipboard
Copied
oo you are just a wonderful person)) Thank you. I would still like to understand why this line was interfering
Copy link to clipboard
Copied
you have two stages with that code