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