handling various frame layouts in android
Posted
by
vaibhav
on Game Development
See other posts from Game Development
or by vaibhav
Published on 2012-06-27T15:13:08Z
Indexed on
2012/06/27
15:27 UTC
Read the original article
Hit count: 489
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?
© Game Development or respective owner