javascript - collision detection fabrics js -
I am using clothes js, I use the following function to put an image on the canvas, when I If I click on the canvas then keep an image in that place, I should know that there is no way that I can check the weather, some place already exists where I am specifically clicking if someone else Whether the image is or not
document.getElementById ("door"). Onclick = function (canvas.On ('mouse: down', function (o) {fabric.Image.fromURL ('http: // localhost: 60099 / images / door.png', function (IMG) {var pointer = Canvas.getPointer (oe); logo = img.set ({left: pointer.x, top: pointer.y}) canvas.ed (logo); canvas.itm (objc). LockmovementY = true; canvas.itm ( OBJC). LockMovementX = true; canvas.reader ();});}); }
Can be detected with clothes. Js 'intersectsWithObject' function Consider their 'intersection' example:
Comments
Post a Comment