【发布时间】:2009-09-19 07:50:24
【问题描述】:
当我尝试将 UIView 与 cocos2d 一起使用时,我遇到了问题。 我创建 UIViewController,为其添加视图并将视图添加到窗口:
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
这是从窗口中移除视图并运行其他 cocos 场景的功能:
-(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。 然后我第一次用这个视图运行场景,这个视图方向是横向,但下一次是纵向,我无法解决这个问题。有人帮助我,请:)
【问题讨论】:
-
这是下一次:tinyurl.com/myk3yw
标签: iphone uikit cocos2d-iphone