views:

93

answers:

2

Hi, I need HTML5 canvas framework to do:

  • draw object (e.g. rectangle)
  • on onmouseover event of the object change color/border style
  • on click do some js action

thx

EDIT: I have finally decided to use raphaeljs (alternative would be dojo). This framework is awesome. (It doesn't need HTML5 canvas and uses SVG)

+2  A: 

It sounds like what you really want is a retained mode graphics interface, where you can create an object, get mouse events on it, change properties on it, move it etc and have the browser cope with redrawing the screen as necessary. In this case you would be better off with SVG instead of <canvas>, which as an immediate mode graphics surface really is just a box full of pixels.

bobince
Yep, SVG is what would be the easiest way to go. As far as I know, there are no canvas libraries that support the kind of event detection as you want.
Jani Hartikainen
A: 

Take a look at this question:

http://stackoverflow.com/questions/3474608/what-is-the-current-state-of-the-art-in-html-canvas-javascript-libraries-and-fram

Fabric.js is mightly impressive and CAKE is also a decent library.

Castrohenge
Thx, I have already tried Fabric.js. It's amazing, but the guys don't solve animation and events problem (at least not as a common functionality).
ChRapO
Have you tried CAKE?
Castrohenge
No, there is a problem that the project is death. But current functionality is good.
ChRapO
Pretty sad it's dead. Very impressive work.
Castrohenge