TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

OCanvas – an object-based canvas drawing library

34 pointsby hakimabout 14 years ago

6 comments

woogleyabout 14 years ago
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?<p>[1]: <a href="http://raphaeljs.com/" rel="nofollow">http://raphaeljs.com/</a>
nekoZonbiabout 14 years ago
Recently, I have been examining various 2D html APIs. I find the oCanvas API to be excellent.<p>In comparison with Raphael, I find that both libraries are good and useful.<p>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.<p>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.<p>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.<p>Some differences that I found: Raphael have support for paths, vector fonts, and premade charts, which oCanvas doesn’t have.<p>On the other hand, oCanvas have support for animated sprites, scenes and timeline/game loop.
DanielRibeiroabout 14 years ago
EaselJS is much easier to write it. <a href="http://easeljs.com/" rel="nofollow">http://easeljs.com/</a><p>And with real classes, and real methods. O canvas seems like the graphics class alone: <a href="http://easeljs.com/docs/Graphics.html" rel="nofollow">http://easeljs.com/docs/Graphics.html</a>
zyangabout 14 years ago
Similar to EaselJS, <a href="http://easeljs.com/" rel="nofollow">http://easeljs.com/</a>
fomojolaabout 14 years ago
Looks nice, but as the first comment says: seems to recreate what RaphaelJS does.<p>And, the demo site fails utterly on IE7: the documentation website says nothing about browser compatibility.
评论 #2373599 未加载
评论 #2373129 未加载
noduermeabout 14 years ago
Actually it's very similar to StrikeDisplay (posted a while back, but I don't think anyone saw it): <a href="http://news.ycombinator.com/item?id=1816482" rel="nofollow">http://news.ycombinator.com/item?id=1816482</a> <a href="http://strikedisplay.blogspot.com" rel="nofollow">http://strikedisplay.blogspot.com</a><p>SD tries to handle things like child objects dispatching events up the display chain and implementing an AS3-style pseudolanguage...