Copy link to clipboard
Copied
Hello,
I am not much experienced with coding but managed to make simple drag and drop objects in various frames of a HTML5 Canvas document. I would like to add a restart button for each frame to place back objects (Movie Clips) to their original position. Not sure how to go from there !
Files available here:
http://www.violinopedia.com/TEST.zip
Thank you !
Code for objects is only:
object.on("mousedown", function(e)
{
e.currentTarget.offsetX = stage.mouseX / stage.scaleX - e.currentTarget.x;
e.currentTarget.offsetY = stage.mouseY / stage.scaleY - e.currentTarget.y;
});
object.on("pressmove", function(e)
{
e.currentTarget.x = stage.mouseX / stage.scaleX - e.currentTarget.offsetX;
e.currentTarget.y = stage.mouseY / stage.scaleY - e.currentTarget.offsetY;
});
Copy link to clipboard
Copied
try this tutorial. https://www.youtube.com/watch?v=JYBWehkks_Y