Got your Official OUYA username? Then Register that same username here at OUYAForum so that there is no confusion! Signup Now!
Results 1 to 2 of 2

Thread: multiple Activities/Views or just one?

  1. #1
    OUYA Developer zeha's Avatar
    Join Date
    Jan 2013
    Posts
    120


    Did you find this post helpful? Yes | No

    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?

  2. #2
    Administrator James Andrew Coote's Avatar
    Join Date
    Oct 2012
    Location
    Nottingham
    Posts
    980


    Did you find this post helpful? Yes | No
    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)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •