by Alan » Tue Nov 02, 2010 4:29 pm
You probably shouldn't put your buttons in a canvas (although you could put canvas in your buttons).
If you want to create buttons on a canvas, the solution really depends on how they should look and behave. The only general answer I can offer is that it involves drawing stuff (possibly after "wiping" the canvas by filling it with a solid colour) and listening for mouse events.
Of course you could also do crazy things like rendering the buttons off-screen and using Data URIs and CSS to change the (background) image sources of elements on the page in response to input events.