Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am trying create a Contra or the old TMNT game (but a simple one) like game for Android. For the game I decided to divide my main screen in three parts - upper for stats, mid for the game and lower for controls.

My main.xml is

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<FrameLayout
    android:id="@+id/upper_bar"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_weight="1" >
</FrameLayout>

<FrameLayout
    android:id="@+id/fl"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_weight="0.5" >
</FrameLayout>

 <FrameLayout
    android:id="@+id/low_bar"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_weight="0.85" >
</FrameLayout>


</LinearLayout>

So I have created the gameview and gameloopthread classes for the mid surface(which is pretty standard). My problem is I don't know how to draw in the upper and lower frame layouts. Should I make new classes for view and thread for each layout, should I do all this in the gameview class itself or is there any better way to implement this?

share|improve this question
add comment

1 Answer

You can now add the GUI and/or game components to the frames you've created. This can be done either from Java code or in your XML layout (recommended). For an example of both ways, please see this tutorial: http://mobile.tutsplus.com/tutorials/android/android-sdk_frame-layout/

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.