संभव डुप्लिकेट:
Android OpenGL ES Transparent Backgroundएंड्रॉइड, पारदर्शी उप-जीएलएसयूफेस व्यू?
मैं सामान्य 2 डी ui लेआउट स्क्रीन के शीर्ष पर कुछ 3 डी वस्तु प्रदर्शित करना चाहते हैं।
2 डी यूई स्क्रीन में पृष्ठभूमि छवि है, और GLSurfaceView सामग्री लेआउट का बच्चा है।
मैं ApiDemos नमूने में पारभासी GLSurfaceView का एक ही तकनीक,
की कोशिश की लेकिन GLSurfaceView सभी को साफ करता है और काले रंग की पृष्ठभूमि को दर्शाता है।
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/my_background_image"
>
...
<android.opengl.GLSurfaceView android:id="@+id/glview"
android:layout_width="fill_parent"
android:layout_height="300px"
android:windowIsTranslucent="true" (i'm not sure this is right)
/>
</LinearLayout>
setContentView(R.layout.main);
...
glview = (GLSurfaceView) findViewById(R.id.glview);
glview.setEGLConfigChooser(8, 8, 8, 8, 16, 0);
glview.getHolder().setFormat(PixelFormat.TRANSLUCENT);
glview.setRenderer(this);
...
gl.glClearColor(0, 0, 0, 0);
...
मैं इस स्थिति में अंतर्निहित पृष्ठभूमि छवि की रक्षा कर सकते हैं?
धन्यवाद, कि मैं क्या चाहते हो। – efeyc
@ पी। मेलच यह सभी विचारों के शीर्ष पर GlSurfaceView बनाता है। अब मैं GlSurfaceView पर एक और दृश्य सेट करने में असमर्थ हूं। GlSurfaceView पारदर्शी बनाने के लिए कोई और तरीका है। –
@ पी। मेलच एक ही समस्या ज़ेडर-टॉप अन्य दृश्यों को GLsurfaceview – ask4solutions