CCClippingNode bug

时间:2014-04-30 03:05:37   收藏:0   阅读:627

在Cocos2d-x v2.x,CCClippingNode类有一个bug,导致区域裁剪失效,由于Cocostudio的UIScrollview组件是基于该类构建的,所以这个问题是比较常见的,fix的方法如下

for iOS:
in AppController replace the gl-view creation with:

    EAGLView *__glView = [EAGLView viewWithFrame: [window bounds]
                                     pixelFormat: kEAGLColorFormatRGBA8
                                     depthFormat: GL_DEPTH24_STENCIL8_OES
                              preserveBackbuffer: NO
                                      sharegroup: nil
                                   multiSampling: NO
                                 numberOfSamples: 0];

for Android:
in game Cocos2dxActivity :

    public Cocos2dxGLSurfaceView onCreateView() {
        Cocos2dxGLSurfaceView glSurfaceView = new Cocos2dxGLSurfaceView(this);
        glSurfaceView.setEGLConfigChooser(5, 6, 5, 0, 16, 8);
        return glSurfaceView;
    }

CCClippingNode bug,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!