cocos2dx 实现遮罩
阅读原文时间:2023年07月15日阅读:1

参考博文: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. this.initView();
  5. }

如果按照博文里面的位置设置有些机型会启动不起来,直接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. }

手机扫一扫

移动阅读更方便

阿里云服务器
腾讯云服务器
七牛云服务器

你可能感兴趣的文章