Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML5 canvas advanced framework

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)

like image 762
ChRapO Avatar asked Oct 10 '10 10:10

ChRapO


3 Answers

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.

like image 89
bobince Avatar answered Oct 14 '22 01:10

bobince


Don't forget about KineticJS, which performs much better than the ones you've mentioned, plus it has a much simpler API

like image 31
Eric Rowell Avatar answered Oct 13 '22 23:10

Eric Rowell


Take a look at this question:

What is the current state of the art in HTML canvas JavaScript libraries and frameworks?

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

like image 23
Castrohenge Avatar answered Oct 14 '22 01:10

Castrohenge