Skip to content

Comment on Why Canvas is not an obvious choice for web games

Comments

I have found that the performance you get with canvas as opposed to using a DOM based rendering varies greatly with the device and rendering engine that your code runs on (shouldnt be a suprise really).

For my game I have encapsulated redering to use webkitTransform and translate3d if hardware acceleration is present. Otherwise use canvas, or in the worst case (IE6-8), use DOM with left and top css attributes.

If your game, like mine, can use a form of dirty-rectangle, invalidation strategy to rendering, its possible to do 60fps rendering with low CPU usage on iOS and desktop browsers.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.