Game Development Reference
In-Depth Information
Table 7-3. Main Attributes of doom.xml (continued)
Attribute
Meaning
android:src="@drawable/up"
Defines the bitmap source of the widget (applies to image
view only). The format is @drawable/NAME , where NAME is
the bitmap filename saved under the res/drawable folder
of the project.
android:layout_alignParentBottom="true"
Tells the relative layout to align the widget to the bottom
of the parent, possibly overlapping other widgets.
android:layout_alignParentLeft="true"
Tells the relative layout to align the widget to the left of
the parent, possibly overlapping other widgets.
android:visibility="gone"
Sets the visibility of the widget. Possible values are
visible or gone (indicates the widget occupies no space).
Listing 7-3. Doom Game UI layout doom.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<!-- GAME IMAGE -->
<ImageView android:id="@+id/doom_iv"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:adjustViewBounds="true"
android:visibility="visible"
android:background="@drawable/doom"
android:focusableInTouchMode="true"
android:focusable="true"/>
<!-- Nav Controls -->
<TableLayout android:id="@+id/pan_ctls"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:visibility="gone"
android:focusable="false"
android:focusableInTouchMode="false">
<TableRow>
<ImageButton android:id="@+id/btn_upleft"
Search WWH ::




Custom Search