what are adventages and disadventages of creating games in 'pure' DOM and using canvas?
+1
A:
With canvas you can perform operations such as rotation that you can't do with pure dome without use some "heavy" tricks. Anyway the dom is faster and you can use it in every browser without problems. You must think about what are you going to use in the game, if you will use only basic operations use the dom otherwise choose the canvas.
mck89
2010-02-15 14:23:19
DOM is really faster? You're sure? I made simple pre-game engine with 2-3 moving elements in DOM and it was terrible. Ive never tried canvas, but examples i saw in internet was pretty much fast (faster then other DOM games i saw). Where i can read about that?
budzor
2010-02-15 14:29:17
I'm absolutely sure. Think about the fact that canvas must manipulate a large amount of data.
mck89
2010-02-15 14:36:44
Um, no, the common reason to use canvas is that it's faster than creating and modifying 1000s of DOM elements.
Nickolay
2010-02-15 16:06:26
Yeah if you have 1000s dom elements, but i was talking about a simple interface. As i said in the answer if you want to use simple things (graphic included) choose the dom otherwise choose the canvas.
mck89
2010-02-16 09:55:25
Anyway think about that the event management is very easy with dom elements while with canvas is more complicated.
mck89
2010-02-16 09:57:44
A:
This blog post may be helpful. It compares Canvas vs DOM
http://blog.frontendforce.com/2010/03/games-development-in-javascript-canvas-vs-dom-benchmark/
Canvas is fast.
Drew LeSueur
2010-06-30 08:02:16
A:
MichalBE
2010-07-19 16:46:22