I had to add some code in Cocos2dxGLSurfaceView.java
in the initView method :
mRenderer = new Cocos2dxRenderer(); setFocusableInTouchMode(true); setEGLConfigChooser(8, 8, 8, 8, 16, 0); setRenderer(mRenderer); getHolder().setFormat (PixelFormat.TRANSLUCENT);
and in the Cocos2dxRenderer
modify the onSurfaceCreated(GL10 gl, EGLConfig config) method:
public void onSurfaceCreated(GL10 gl, EGLConfig config) { nativeInit(Cocos2dxActivity.screenWidth, Cocos2dxActivity.screenHeight); last = System.nanoTime(); gl.glDisable(GL10.GL_DITHER); gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_FASTEST); gl.glClearColor(0,0,0,0); gl.glEnable(GL10.GL_CULL_FACE); gl.glShadeModel(GL10.GL_SMOOTH); gl.glEnable(GL10.GL_DEPTH_TEST); }
With this I get a transparent openGLview background by the way I will make a post about my application done with cocos2dx for iPhone and android very soon
原文地址http://www.cocos2d-x.org/boards/6/topics/4804