objective-c – CCLiquid使我的屏幕变黑
发布时间:2020-12-16 07:28:41 所属栏目:百科 来源:网络整理
导读:我正在使用cocos2d- iphone,最新的非beta版本. 最近我发现这个:http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:effects,我对CCLiquid或CCWaves感兴趣,在我的游戏中有一些水效果. 但是,当我在我的CCSprite上应用CCLiquid动作时,除sprite本身之外的
我正在使用cocos2d-
iphone,最新的非beta版本.
最近我发现这个:http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:effects,我对CCLiquid或CCWaves感兴趣,在我的游戏中有一些水效果. 但是,当我在我的CCSprite上应用CCLiquid动作时,除sprite本身之外的所有内容都呈现为黑色.好吧,不完全是.当我增加动作的幅度时,我注意到它实际上是一个黑色背景,屏幕大小直接在我的CCSprite下生成(这样的背景也被“挥手”). 即使这不是3D动作(至少没有3D后缀),我决定按照该页面上的提示将其放在我的代表身上: [[CCDirector sharedDirector] setDepthBufferFormat:kDepthBuffer16]; 但无论如何都无法识别kDepthBuffer16. 有任何想法吗? 编辑:可能值得一提的是我的精灵正在使用CCAnimate进行动画处理. 解决方法
使用版本1.0.1,这为我修复了它(静态图像,没有动画).这是在AppDelegate(在我的情况下):
- (void) applicationDidFinishLaunching:(UIApplication*)application { // Init the window window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; if( ! [CCDirector setDirectorType:kCCDirectorTypeDisplayLink] ) { [CCDirector setDirectorType:kCCDirectorTypeDefault]; } CCDirector *director = [CCDirector sharedDirector]; // Init the View Controller viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil]; viewController.wantsFullScreenLayout = YES; // Create the EAGLView manually EAGLView* glView = [EAGLView viewWithFrame:[window bounds] pixelFormat:kEAGLColorFormatRGBA8 depthFormat:GL_DEPTH_COMPONENT16_OES preserveBackbuffer:NO sharegroup:nil multiSampling:NO numberOfSamples:0]; // attach the openglView to the director [director setOpenGLView:glView]; // ... etc here } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |