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.

Why Canvas is not an obvious choice for web games

43 pointsby binomialover 14 years ago

7 comments

jasonkesterover 14 years ago
I'm with this guy. Canvas is great, but it's an element to include in your scene to render vector graphics, not a container for you to render your scene inside. Often you'll have dozens of them layered about the place, happily doing their thing and unaware of each other.<p>Use it right and it's a great tool. Try to use it as a panacea Flash replacement and you're in for a bunch of headache.
评论 #1950335 未加载
评论 #1950050 未加载
voidpointerover 14 years ago
I think he is comparing apples to oranges here. Using HTMl as the "rendering device" works on a different (higher) level of abstraction. The additional layer of abstraction in HTML has already solved the complexity of doing efficient partial redraws based on changes to a subset of a scene graph. This isn't something that the canvas API was meant to handle. If one were to use a scene graph (or display list) abstraction on top of canvas, it would shield the application developer from this complexity just as well as the HTML does now. However, the HTML abstraction, although more general, is implemented in native code while a canvas based scene-graph would need to go through java-script, so it is at a disadvantage as to how far it can be optimized. Basically, what he needs is SVG. :-)
评论 #1950183 未加载
kuahyeowover 14 years ago
This depends on the type of the game, but a fellow developer is beta-testing a canvas based game <a href="http://esdao.com" rel="nofollow">http://esdao.com</a> . It's works quite well, with the exception of Mobile Safari to my recollection which is supposed to perform better with the next iOS update.
评论 #1949793 未加载
jluxenbergover 14 years ago
For anyone wondering what happened to Dextrose (the company Bakaus founded to make the Aves HTML5 game engine), it was bought by Zynga back in May. He is now the CTO of Zynga Germany.
steve19over 14 years ago
WebGL should fix this problem.
评论 #1949853 未加载
bniover 14 years ago
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).<p>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.<p>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.
Tyrant505over 14 years ago
So is UO or a good, top down perspective rpg coming to canvas soon? Which have been announced?