News for hackers. Stuff that matters.
Re:OCanvas – an object-based canvas drawing library by woogley on Saturday March 26, 2011 @11:40AM (#2372322)
Interesting, but it feels like a re-implementation of SVG. What is the advantage of this over something like RaphaelJS[1], where the SVG/VML objects are actual DOM objects already?

[1]: http://raphaeljs.com/

Re:OCanvas – an object-based canvas drawing library by nekoZonbi on Saturday March 26, 2011 @01:17PM (#2372600)
Recently, I have been examining various 2D html APIs. I find the oCanvas API to be excellent.

In comparison with Raphael, I find that both libraries are good and useful.

In computer graphics, there are two main approaches for 2D: vector and bitmap. Each one has their situations where it is the most convenient. Raphael is SVG based, vector graphics. oCanvas is html canvas based, bitmap graphics. So each one will have situations where it is the most convenient.

For example, scalable graphics, made of solid lines and shapes, are better suited with the vector approach. While diffuse images and image processing is better suited with the bitmap approach.

oCanvas employs object literals to accede to the various graphic operations. I find that makes the code more readable and thus easier to maintain, than the Raphael API, which makes use of plain function parameters for that.

Some differences that I found: Raphael have support for paths, vector fonts, and premade charts, which oCanvas doesn’t have.

On the other hand, oCanvas have support for animated sprites, scenes and timeline/game loop.

Re:OCanvas – an object-based canvas drawing library by DanielRibeiro on Saturday March 26, 2011 @02:45PM (#2372814)
EaselJS is much easier to write it. http://easeljs.com/

And with real classes, and real methods. O canvas seems like the graphics class alone: http://easeljs.com/docs/Graphics.html

Re:OCanvas – an object-based canvas drawing library by zyang on Saturday March 26, 2011 @12:39PM (#2372504)
Similar to EaselJS, http://easeljs.com/
Re:OCanvas – an object-based canvas drawing library by fomojola on Saturday March 26, 2011 @12:38PM (#2372502)
Looks nice, but as the first comment says: seems to recreate what RaphaelJS does.

And, the demo site fails utterly on IE7: the documentation website says nothing about browser compatibility.

Re:OCanvas – an object-based canvas drawing library by koggdal on Saturday March 26, 2011 @07:57PM (#2373599)
As nxn said, IE9 is the first release with canvas support. But even there oCanvas won't work currently I think. Browser compatibility was not my highest priority before the first release. But that will be tested and improved in later releases. I have also noticed that Opera has really weird rendering on both Mac and Windows. Windows browsers in general are also a little quirky on this. But it will be tested and improved more soon.
Re:OCanvas – an object-based canvas drawing library by nxn on Saturday March 26, 2011 @04:45PM (#2373129)
Well, Internet Explorer's canvas implementation only begins with IE9. I would not expect a lib that is based on canvas to work in any previous version of that browser.

EDIT: And even then, you only get the 2d context, can't do any WebGL fancystuff with any IE. (Though I don't think oCanvas does any of that anyway?).

Re:OCanvas – an object-based canvas drawing library by patrickaljord on Saturday March 26, 2011 @06:19PM (#2373380)
WebGL is not really canvas, it used to be called canvas 3d at first but now I think people just refer to it as webgl because it's completely different, I may be wrong though.
Re:OCanvas – an object-based canvas drawing library by noduerme on Saturday March 26, 2011 @01:36PM (#2372645)
Actually it's very similar to StrikeDisplay (posted a while back, but I don't think anyone saw it): http://news.ycombinator.com/item?id=1816482 http://strikedisplay.blogspot.com

SD tries to handle things like child objects dispatching events up the display chain and implementing an AS3-style pseudolanguage...