I need to attach some mouse event on a images in my canvas.
I’ve tried this, but it’s still doestn’t work.
var pointer = new Image();
pointer.src = "/img/line_point.png";
pointer.onload = function() {
context.drawImage(pointer, 55,123);
}
pointer.addEventListener("mouseover", maap, false);
You’ll need to add the event listener to the canvas element and then manually check if the events x and y parameters are over the image drawn on your canvas.