我正在尝试使用黑色 png 图像在 cocos 2d 中制作淡入淡出效果。它是为了更好地展示一些东西,而不是随意的方式......
这段代码有问题吗?
- (void) effectFade {
CCSprite *effectScreen = [CCSprite spriteWithFile:@"black-iphone.png"];
effectScreen.opacity = 0;
[effectScreen runAction:[CCSequence actions:
[CCFadeIn actionWithDuration:1],
[CCCallFunc actionWithTarget:self selector:@selector(hideOutShowIn)],
[CCFadeOut actionWithDuration:1],
[CCCallFunc actionWithTarget:self selector:@selector(finish)],
nil]];
CCFadeTo *fadeIn = [CCFadeIn actionWithDuration:1];
CCFadeTo *fadeOut = [CCFadeOut actionWithDuration:1];
CCSequence *fadeSequence = [CCSequence actionOne:fadeIn two:fadeOut];
}