File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
cocos2d/Platforms/Android Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,19 @@ - (void)run
106
106
screenMode = CCScreenScaledAspectFitEmulationMode;
107
107
}
108
108
109
+ if ([_cocos2dSetupConfig[CCSetupScreenOrientation] isEqual: CCScreenOrientationPortrait])
110
+ {
111
+ self.requestedOrientation = AndroidActivityInfoScreenOrientationSensorPortrait;
112
+ }
113
+ else if ([_cocos2dSetupConfig[CCSetupScreenOrientation] isEqual: CCScreenOrientationLandscape])
114
+ {
115
+ self.requestedOrientation = AndroidActivityInfoScreenOrientationSensorLandscape;
116
+ }
117
+ else
118
+ {
119
+ self.requestedOrientation = AndroidActivityInfoScreenOrientationUnspecified;
120
+ }
121
+
109
122
_glView = [[CCGLView alloc ] initWithContext: self screenMode: screenMode scaleFactor: metrics.density];
110
123
[metrics release ];
111
124
[_glView.holder addCallback: self ];
You can’t perform that action at this time.
0 commit comments