2013-03-12 63 views
2

我有一個來自cocos2d模板的基本cocos2d應用程序,無法讓它在橫向模式下工作。 我的確在這裏和cocos2d論壇上讀了很多消息,但沒有解決方案。Cocos2d 2.0風景適應:howto?

在橫向模式下我的應用程序的開始,但一切都側身拉(精靈,標籤,...)

我更新項目面板的定向(自動更新info.plist中)...

我可能必須在AppDelegate.m文件中添加一些東西(在應用程序中:didFinishLaunchingWithOptions方法),以告訴導演以正確的方式繪製所有內容。

https://gist.github.com/iesta/5143096

預先感謝您...

+1

只是讓應用程序只支持Info.plist中的橫向,它是視圖控制器? – 2013-03-12 14:04:30

回答

0

在AppDelegate.mm

- (NSUInteger)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window 
{ 
    return UIInterfaceOrientationMaskLandscape; 
} 

-(NSUInteger)supportedInterfaceOrientations { 

    return UIInterfaceOrientationMaskLandscape; 
} 



- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
     return UIInterfaceOrientationIsLandscape(interfaceOrientation); 
} 

而且在Xcode摘要屏幕選擇橫向把這些代碼。 enter image description here

更新:得到了您的錯誤,您添加了Default-Portrait〜ipad.png圖像而不是Default-Landscape〜ipad.png。

這裏工作來源:Download

請參閱更改默認的圖像後,這個工作。 enter image description here

+0

謝謝你的回答,但它不會改變任何東西...... :( – Sucrenoir 2013-03-12 14:30:32

+0

ok ..上傳我的zip示例代碼..let e check – Guru 2013-03-12 14:34:14

+0

這裏是mu AppDelegate.m https://gist.github.com/5143431 .git其實它是非常基本的東西 – Sucrenoir 2013-03-12 14:41:51

0

專家嘗試將此行添加到appddelegate

[window_ setRootViewController:navController_];