Take pretty much any mobile game: when you dieBy Game Over menu, I mean a menu is displayed that haswhen you die, with an option to play again.
I have two approaches in mind:
1. Use OpenGL
As in haves some button textures ready and when the character dies, translate them to the screen. Then listen for events on those textures.
2. Use a view
At the moment, when the user opens the game, I have a basic activity, along with a basic view that has a FrameLayout: the root is a GlSurfaceView and on top of it there's a menu (embedded in a LinearLayout). When the user hits "Play", this menu is translated away (using a translate animation) from the screen, leaving only the GlSurfaceView visible, with which the user can interact. I was thinking of implementing something similar when the game ends, but I'm not sure where to start.
Use OpenGL
Have some button textures ready. When the character dies, draw them. Listen for events on those textures.
Use a view
(This is what I'm doing now.) When the user opens the game, I have a basic activity, along with a basic view with a
FrameLayout: The root is aGlSurfaceViewand there's a menu on top of it (embedded in aLinearLayout). When the user hits "Play", this menu is translated away (using a translate animation) from the screen, leaving only theGlSurfaceViewvisible, with which the user can interact. I was thinking of implementing something similar when the game ends, but I'm not sure where to start.
I don't particularly like the first approach, since implementing the button events in OpenGL doesn't seem like a straightforward thingseems hard. So how is it done after all
How should I approach this?