Cocos2D Android 二维码扫描
发布时间
阅读量:
阅读量
在Activity的onCreate方法中,通过引入surfaceView实现摄像头预览功能
group = (ViewGroup)getWindow().getDecorView();
view = new CaptureView(this);
group.addView(view);
view.setZOrderMediaOverlay(true);
随后针对无法预览以及遮挡Cocos2dx UI等各类问题进行处理,在Cocos2dxActivity中对相关函数进行了替换操作:
public Cocos2dxGLSurfaceView onCreateView() {
// return new Cocos2dxGLSurfaceView(this);
Cocos2dxGLSurfaceView glSurfaceView = new Cocos2dxGLSurfaceView(this);
glSurfaceView.setEGLConfigChooser(8, 8, 8, 8, 16, 8);
return glSurfaceView;
全部评论 (0)
还没有任何评论哟~
