Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using <canvas> element from javascript

Is there any JS library designed for working with canvas elements?

I don't really care about IE compatibility. I need to create objects(complex drawings with text) , draw lines between them, linear, bezier with different strokes, and attach event handlers to them(i need mouseOver and click).

Anyone has any experience with a library that has built-in support for this?


EDIT: http://raphaeljs.com/ seems to have these features

like image 909
Quamis Avatar asked Jul 14 '26 11:07

Quamis


2 Answers

Canvas doesnt support javascript, but SVG does. You could use jQuery to attach events etc to elements, just like other Dom elements.

like image 188
James Westgate Avatar answered Jul 19 '26 05:07

James Westgate


CAKE fulfills some of your requirements:

http://glimr.rubyforge.org/cake/canvas.html#KeyboardTest

It's been abandoned by its author, though, so it's doubtful that the areas its lacking in will be improved any time soon.

like image 24
Ant Avatar answered Jul 19 '26 03:07

Ant



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!