즉
[[Director shareddirector] attachInView:myView];
이 내가 그것의 앞에 펜촉에서로드 된 다른 뷰를 오버레이 할 수 있다는 것을 의미한다. 예 : 나는 비슷한 것을 할 수있다. . .
GameViewController *gameViewController;
ScoresViewcontroller *scoresViewController;
....
@property (nonatomic, retain) GameViewController *gameViewController;
@property (nonatomic, retain) ScoresViewController *scoresViewController;
및 아래 applicationDidFinishLaunching 내부 YourAppDelegate.m에서 YourAppDelegate.h
에서
:
// Create the cocos2d view
gameViewController = [[GameViewController alloc] init];
[window addSubview:gameViewController.view];
// Create the high scores view and controller
scoresViewController = [[ScoresViewController alloc] initwithNibName:@"scoresNib"
bundle:nil];
[window addSubview:scoresViewController.view];
마지막으로, GameViewController 안에 당신은 여기
- (void) loadView {
self.view = [[UIView alloc] initWithFrame:CGRectMake(0,0,320,480)];
[[Director sharedDirector] attachInView:self.view];
// Now do your cocos2d scene stuff to start everything off e.g. create a scene
// and call runWithScene: on the sharedDirector
}
의적인 Cocos2D 코드를 할 것이다 백그라운드에서 실행 중이며 점수보기가 전면에 겹쳐져 있습니다 (또는 당신이 그것을 필요로 할 때까지 숨겨지는). 게임은 높은 점수에 뭔가를 할 필요가있을 때
그런 다음 GameViewController은 또한 수 있습니다 this question에
PS에게
YourAppDelegate *appDelegate = (YourAppDelegate *)[[UIApplication sharedApplication] delegate];
appDelegate.scoresViewController.view.hidden = NO;
샘, 즉 응용 프로그램의 대표로부터 답변을 HighScoresViewController를 얻을 수 있습니다 당신에게 유용합니다 :)
안녕하세요, 감사합니다.이 작품은 나를 위해 ....하지만 유일한 생각은 ... ?? – Rony