cocos2dx 实现遮罩

参考博文:http://blog.csdn.net/myarrow/article/details/19913653

参考博文:http://blog.csdn.net/song_hui_xiang/article/details/22809647

强调一下Android部分有个错误的地方:

  1. public Cocos2dxGLSurfaceView(final Context context) {  
  2.     super(context);  
  3.     this.setEGLConfigChooser(5, 6, 5, 0, 16, 8); // 添加此句  
  4.       
  5.     this.initView();  
  6. }  

如果按照博文里面的位置设置有些机型会启动不起来,直接crash。

应该放在:

  1. public abstract class Cocos2dxActivity extends Activity implements Cocos2dxHelperListener {

  2.     public Cocos2dxGLSurfaceView onCreateView() {  
  3.         Cocos2dxGLSurfaceView glSurfaceView = new Cocos2dxGLSurfaceView(this);  
  4.         glSurfaceView.setEGLConfigChooser(5, 6, 5, 0, 16, 8); 
  5.         return glSurfaceView;  
  6.     }      
  7. }  
原文地址:https://www.cnblogs.com/cgw0827/p/4337611.html