Skip to main content
deleted 18 characters in body; edited title
Source Link
House
  • 73.5k
  • 17
  • 188
  • 276

handling Handling various frame layouts in androidAndroid

i'm new to game development andI am trying create a Contra or the old tmntTMNT game (but a simple one) like game for androidAndroid. forFor the game iI decided toto divide my main screen in three parts - upper for stats,mid mid for the game and lower for controls. my

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 iSo I have created the gameviewgameview and gameloopthreadgameloopthread classes for the mid surface(which is pretty standard). myMy problem is thatI don't know how do ito draw in the upper and lower frame layouts? should i. Should I make new classes for view and thread for each layout  , should iI do all this in the gameviewgameview class itself or is there any better way to implement this?

handling various frame layouts in android

i'm new to game development and 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 that how do i 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?

Handling various frame layouts in Android

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?

Source Link
Vaibhav
  • 131
  • 1
  • 4

handling various frame layouts in android

i'm new to game development and 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 that how do i 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?