Hi,
I found this online and figured I'd share it, I just started programing using JPCT-AE and having limited knowledge in java, I experiment a lot.
I wanted to add a HUD of some sort but didn't understand how to "blit" as I read here and there so I searched and found this, please let me know if this will bug or slow down the device:
in HelloWorld demo:
replace:
mGLView = new GLSurfaceView(getApplication());
with
setContentView(R.layout.activity_main); //or whatever the layout you want to use
mGLView = (GLSurfaceView) findViewById(R.id.graphics_glsurfaceview1);
remove
setContentView(mGLView);
now in your layout copy/paste:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/graphics_frameLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<android.opengl.GLSurfaceView
android:id="@+id/graphics_glsurfaceview1"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</android.opengl.GLSurfaceView>
<LinearLayout
android:layout_height="fill_parent"
android:id="@+id/inventory"
android:gravity="center"
android:layout_width="fill_parent"
android:orientation="vertical"
android:visibility="gone">
</LinearLayout>
<LinearLayout
android:id="@+id/HUD"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center|bottom"
android:orientation="vertical" >
<ImageButton
android:id="@+id/imageButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/icon" />
</LinearLayout>
</FrameLayout>
After that play around with placements.
Source where I found it and what it does (2 overlays, 1 for inventory and 1 for hud).
http://stackoverflow.com/questions/8128896/mixing-android-views-and-glsurfaceviewDoing this will keep you from having to blit or making your own opengl, however I don't know enough to know if it will have any undesirable consequences, please let me know.