Android GLSurfaceView

Is it possible to add LinearLayout to GLSurfaceView? How to overlay LinearLayout on GLSurfaceView? perhaps GLSurfaceView is a playground, and LinearLayout is a menu.

+4
source share
1 answer

Use FrameLayout. Try GLSurfaceView as the first view in FrameLayout, and then add a second LinearLayout. This will put linearLayout and anything in it on top of the GLSurfaceView:

<FrameLayout android:id="@+id/graphics_frameLayout1" android:layout_width="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" 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/linearLayout1" android:gravity="center" android:layout_width="fill_parent" android:orientation="vertical"> </LinearLayout> </FrameLayout> 

Edit: now with image:

Android Framelayout for games. Check out ma ms paint skillz

+12
source

Source: https://habr.com/ru/post/1382510/


All Articles