DOM or Canvas ?

DOM or Canvas ?
0.0 0


I’m new to web development.

Can you point me out the benefits of using one over another?


Dom is good at STATIC UI. If you have a lot of buttons and menu items which don’t need to be changed frequently, Dom Menu will be a good choice.

You may consider both Dom and canvas in the rest.


Much Thanks Shun Lin!


DOM is also better for games for older iOS before iOS 5.0 where canvas performance was awful. And DOM on newer devices is still good.

But Cocos2d-HTML5 doesn’t have support for DOM, it is canvas, right?


we have dom menu since alpha 2, which is a subsitute for and cc.menuitem

the api are the same.

it is still experimenting, and does not run actions natively, to run actions, you have to add dom nodes to normal cc.node, then run the action on the cc.node