Should I render all of my HUD views to a single SurfaceView?

| | August 11, 2015

I’m using a SurfaceView and canvas to implement a game HUD, title screens etc., by overlaying standard Android view widgets over my SurfaceView. This works reasonably well and maintains an acceptable frame-rate, but it is a simple game with little happening on or off screen.

I have handlers flinging messages around and runOnUiThreads everywhere. Quite cumbersome. Can I draw all my views to the one SurfaceView, controlled by the main game thread? Is there an advantage to this?

One Response to “Should I render all of my HUD views to a single SurfaceView?”

  1. actually you could draw all that staff on your canvas but you need to handle that ui things from strach, like getting user touch points and detecting whether user touched a button or not

Leave a Reply