If you want to make your activity transparent. you will acesse 4 steps
Step1:
Add “Translucent” to
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
Step2:
Open the commit code in this java class
getWindow().setFormat(PixelFormat.TRANSLUCENT);
Step3
Open this CCDirector.cpp file
Under project/cocos2d/cocos/2d
And find this function modify last alpha value(from 0.0f - 1.0f) to your want
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
Step4
Open this nativeactivity.cpp file
Under project/cocos/2d/platform/android
And find this function modify
const EGLint attribs[] = {
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
EGL_BLUE_SIZE, 5,
EGL_GREEN_SIZE, 6,
EGL_RED_SIZE, 5,
EGL_DEPTH_SIZE, 16,
EGL_STENCIL_SIZE, 8,
EGL_NONE
};
To
const EGLint attribs[] = {
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
//EGL_BLUE_SIZE, 5, -->delete
//EGL_GREEN_SIZE, 6, -->delete
//EGL_RED_SIZE, 5, -->delete
EGL_BUFFER_SIZE, 32, //-->new field
EGL_DEPTH_SIZE, 16,
EGL_STENCIL_SIZE, 8,
EGL_NONE
};
1.png (207.4 KB)
2.png (150.9 KB)
3.png (130.0 KB)
4.png (80.2 KB)
5.png (168.2 KB)
6.png (85.2 KB)