Android - Rendering HUD View to SurfaceView

Posted by Jon on Game Development See other posts from Game Development or by Jon
Published on 2013-03-29T21:12:32Z Indexed on 2013/10/18 16:15 UTC
Read the original article Hit count: 342

Filed under:
|
|

I have developed a relatively simple game in android, to get my head around it all, and on the back of it developed a crude game engine (in the loosest sense!). I use a SurfaceView and canvas (no OpenGL) - I'll cross that bridge another time!

I have implemented a game HUD, title screens etc. by overlaying standard Android view widgets over my SurfaceView. This all works reasonably well maintaining an acceptable frame-rate, but it is a simple game with not a lot happening on or off screen.

What I am wondering now is whether one could (and whether one would get any advantage by) drawing all my views to the one SurfaceView, all controlled by the main game thread. At the moment I have handlers flinging messages around and runOnUiThreads here, there and everywhere. Quite cumbersome.

Any thoughts on this would be much appreciated (before I perhaps waste time trying to do it!)

© Game Development or respective owner

Related posts about android

Related posts about canvas