Cocos2d-x中的那些坑--ScrollView,ClippingNode在Android上显示不正常的解决方法

来源:互联网 发布:立健亭止咳药水 知乎 编辑:程序博客网 时间:2024/05/17 07:24

ScrollView,ClippingNode在一些Android平台上显示会出现显示不正确,且甚至影响其他图片的显示为白块的问题,原因是这2个类的对象都是用到了裁剪的功能,该问题的解决方案如下:

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 org.cocos2dx.lib.Cocos2dxActivity.java:
public Cocos2dxGLSurfaceView onCreateView() { Cocos2dxGLSurfaceView glSurfaceView = new Cocos2dxGLSurfaceView(this); glSurfaceView.setEGLConfigChooser(5, 6, 5, 0, 16, 8); return glSurfaceView; }

本文参考了以下的原贴:

http://discuss.cocos2d-x.org/t/how-to-use-ccclippingnode/5086

0 0
原创粉丝点击