Cocos2D自动移动90度

时间:2012-04-21 09:16:54

标签: ios cocos2d-iphone rotation

自动旋转时,我设置

GAME_AUTOROTATION = kGameAutorotationUIViewController

#elif GAME_AUTOROTATION == kGameAutorotationUIViewController    
    return ( UIInterfaceOrientationIsLandscape( interfaceOrientation ) );

这意味着如果我以横向方向握住设备,它将自动旋转。事实上,旋转总是移动90度(即当我旋转到横向右边时,我会得到肖像)。

我如何解决此问题?

1 个答案:

答案 0 :(得分:1)

设置GAME_AUTOROTATION的正确方法是:

#define GAME_AUTOROTATION kGameAutorotationUIViewController

(我在GameConfig.h中有我的。)

我无法理解GAME_AUTOROTATION = kGameAutorotationUIViewController,所以只是认为这可能是问题的原因(如果你这样使用它)。

在任何情况下,如果您仍然遇到自动旋转问题,请在willRotateToInterfaceOrientation中设置断点并检查从那里发生的事情;与willAnimateRotationToInterfaceOrientation相同。