I want to try creating shapes in javascript+canvas.. Is there a开发者_高级运维 tool to transform drawings into js code ?
Have a look at Processing.js.
If you happen to have Flash you can draw in Vector format and convert to javascript and canvas using the newly released Swiffy tool from Google : http://swiffy.googlelabs.com/
Of course if you don't have Flash then that doesn't help much..
Another option could be to use DeviantART's muro web app : http://muro.deviantart.com/ . It's a drawing app made using only javascript and canvas and it looks pretty badass for a web app. I don't know if you can get the source of your drawing though, you'd have to experiment with this a bit.
Yes, there is such online tool!
It's called HTML Canvas Studio. It allows you to draw whatever you want, the same way you do in other Paint programs. When you finish, just export it to HTML+JS.
You can find it here: http://www.htmlcanvasstudio.com/
I found a way (sort of):
- draw something using Inkscape, save as svg
- open the svg file, find the
definition of the shape (something
like
M10 10L90 90
) - use that in the
js framework Raphaël :
paper.path("M10 10L90 90");
精彩评论