Stefan
Stefan

Reputation: 14883

HTML5 Canvas overlaying images

I'm using the konvajs library to draw multiple images to a canvas. The images are transparent on certain points.

Now I want to attach a click handler to the images, but the click handler shouldn't be fired if the image is transparent on that point / promote the click handler to the udnerlying image.

However currently the image on top get's all the click handlers. Is there a way to ignore click events on transparent parts of an image?

Upvotes: 2

Views: 390

Answers (1)

Stefan
Stefan

Reputation: 14883

After looking throw the konvajs doku, I found this image sample: http://konvajs.github.io/docs/events/Image_Events.html

Hovering the lion does exactly what I want!

Upvotes: 1

Related Questions