tags:

views:

337

answers:

2

Hi, Is there a way to attach an event handler to a object drawn on HTML5 Canvas, without tracking the points? Cheers, I

A: 

There is not, you can only receive events for the entire element. For a Canvas, you need to handle things like picking and event propagation yourself. If you want to attach event handlers to individual drawn elements, you could think about using SVG instead of Canvas.

wump
A: 

Take a look at Cake. It's a scene graph plug-in for canvas elements. You should be able to attach event handlers to canvas objects with it.

JoshNaro