HTML5 Game (Canvas) - UI Techniques?
Posted
by
Jason L.
on Game Development
See other posts from Game Development
or by Jason L.
Published on 2011-01-05T01:47:50Z
Indexed on
2011/01/05
2:00 UTC
Read the original article
Hit count: 234
Hi!
I'm in the process of building a JavaScript / HTML5 game (using Canvas) for mobile (Android / iPhone/ WebOS) with PhoneGap. I'm currently trying to design out how the UI and playing board should be built and how they should interact but I'm not sure what the best solution is. Here's what I can think of -
Build the UI right into the canvas using things like drawImage and fillText Build parts of the UI outside of the canvas using regular DOM objects and then float a div over the canvas when UI elements need to overlap the playing board canvas. Are there any other possible techniques I can use for building the game UI that I haven't thought of? Also, which of these would be considered the "standard" way (I know HTML5 games are not very popular so there probably isn't a "standard" way yet)? And finally, which way would YOU recommend / use?
Many thanks in advance!
© Game Development or respective owner