3
當我嘗試使用UIView與cocos2d我有一個問題。 我創建的UIViewController,添加視圖,並添加視圖窗口:Cocos2d vs UIKit
helpController=[[HelpController alloc] init];
helpController.view=view;
[[[[Director sharedDirector] openGLView] window] addSubview: helpController.view];
@interface HelpController : UIViewController
{
}
@end
@implementation HelpController
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
return YES;
}
@end
這是從窗口中刪除視圖,並運行其他科科斯場景功能:
-(void)back:(id)sender {
FadeTransition *tran=[FadeTransition transitionWithDuration:0.5f scene:[MainMenuScene node]];
[helpController.view removeFromSuperview];
[[Director sharedDirector] replaceScene:tran];
}
首播時間: http://tinyurl.com/nu98ub
屏幕方向是UIInterfaceOrientationLandscapeRight。 第一次然後我用這個視圖運行場景,這個視圖方向是橫向,但下一次是肖像,我無法解決這個問題。有人幫助我,請:)
這是下一次: http://tinyurl.com/myk3yw – 2009-09-19 07:50:41