Got your Official OUYA username? Then Register that same username here at OUYAForum so that there is no confusion! Signup Now!
-
OUYA Developer
Did you find this post helpful?

|
multiple Activities/Views or just one?
hey,
I just wondered whether it's more common to use several views and activities for android games or just one.
I currently have divided my app into game and title, but now I am thinking about adding the next activity/viw-pair and I wonder if that is really the best practice.
how do you guys do it?
-
Administrator
Did you find this post helpful?

|
I usually have 1 activity for the main menu screen and 1 activity for the actual game.
You can switch views around without starting a new activity. For example, my game has a base view, which never changes throughout the lifecycle of the game activity. It is a FrameLayout with the GLSurfaceView (openGL canvas) at the bottom, and a couple of LinearLayouts on top. The middle LinearLayout I add/remove children from programatically as the game goes on to show different UI elements. The top LinearLayout is a loading screen, which I programatically make visible when stuff is loading and invisible when it has finished loading (like the curtain sreen at a theatre). That way, the player isn't exposed to half-loaded models or scenes
Many games will however have all the GUI stuff done in OpenGL, which gives a performance boost, especially when you have complex UI stuff happening. It is however harder to program (as you can't just drag and drop android ui widgets into a layout)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks