이것은 기본 이미지가 iOS에서 제공 된 후에 로고를 페이드 인/아웃하는 방법입니다. SplashLogo 클래스 (장면)가 있습니다. 내 시작 장면입니다. , 로고를 표시하고 페이드 아웃 한 다음 게임 컨트롤러로 달리기 장면으로 대체합니다.
- (void)onEnter {
[super onEnter];
self.positionType = CCPositionTypePoints;
// todo : test this background seed, GL side effects, timing, etc ...
// [self performSelectorInBackground:@selector(seedGameSequencer) withObject:nil];
[self seedGameSequencer];
CCColor *color = [CCColor colorWithRed:0 green:0.f blue:0.f alpha:0.f];
CCNodeColor *black = [CCNodeColor nodeWithColor:color];
black.positionType = CCPositionTypePoints;
black.position = ccp(0, 0);
black.anchorPoint = ccp(0, 0); // bottom left
[self addChild:black];
[GESprite mediumPixelFormat];
CCSprite *logo = [CCSprite spriteWithImageNamed:@"maxPowerStudiosLogo.png"];
logo.positionType = CCPositionTypePoints;
logo.anchorPoint = ccp(.5, .5);
logo.opacity = 0;
logo.positionInPoints = ccp(black.contentSizeInPoints.width/2, black.contentSizeInPoints.height/2);
[GESprite defaultPixelFormat];
id fadein = [CCActionFadeIn actionWithDuration:3 * K_FADE_TIME];
id taponne = [CCActionDelay actionWithDuration:.95];
id fadeout = [CCActionFadeOut actionWithDuration:2 * K_FADE_TIME];
id swapSceneAction = [CCActionCallFunc actionWithTarget:self selector:@selector(swapScene)];
id seq = [CCActionSequence actions:fadein, taponne, fadeout, swapSceneAction, nil];
// add the label as a child to this Layer
[self addChild:logo];
[logo runAction:seq];
}
- (void)seedGameSequencer {
mainScene = [MPGameSequencer scene];
}
- (void)swapScene {
[[CCDirector sharedDirector] replaceScene:mainScene];
}
과 AppDelegate에210 : 명확하지 않은 질문에 대한 upvotes의
- (CCScene *)startScene {
// This method should return the very first scene to be run when your app starts.
return [SplashLogo scene];
}
와우, 많이! '기본 이미지'로 '스플래시 화면'으로 '두 번째 이미지'로 '첫 번째 이미지'는 무엇입니까? .... 그들은 어떻게 든 관련이 있습니까 ??? 상황에 따라 2 초를 표시해야하며 3 초를 표시하기 위해 다른 질감이 필요한 상황이 있습니까? – YvesLeBorg