Cocos2d-x3.1.1 in android to set horizontal and vertical screen, cocos2dandroid
In the AndroidManifest. xml file of proj. android in the project, it is easy to modify the information !!!
ScreenOrientation = "landscape" is a landscape screen,
ScreenOrientation = "portrait" is a portrait Screen
How does android determine whether the current screen is landscape screen or landscape screen?
Use this method to getActivity (). getResources (). getConfiguration (). orientation
1 vertical screen 0 horizontal screen
In android compilation, how does one configure the default display of landscape and landscape screens?
5. Modify the portrait Screen Display
You must modify the source code and re-compile the code to implement this function.
Frameworks/base/core/res/values/config. xml
Before modification: <integer name = "config_lidOpenRotation"> 90 </integer>
After modification: <integer name = "config_lidOpenRotation"> 0 </integer>
In addition:
Sets the direction of the Activity main window. The direction in the array is set to the screenOrientation attribute in the R. attr class,
* The value of screenOrientation must be a constant value.
* ActivityInfo. SCREEN_ORIENTATION_UNSPECIFIED:
* If no direction is specified, the system determines the best direction of the Activity.
* ActivityInfo. SCREEN_ORIENTATION_LANDSCAPE:
* You want the Activity to be displayed on the horizontal screen, that is, the horizontal width must be greater than the vertical height, and the influence of the direction sensor is ignored.
* ActivityInfo. SCREEN_ORIENTATION_PORTRAIT:
* You want the Activity to be displayed on the portrait screen, that is, the portrait height must be greater than the horizontal width, and the impact of the orientation sensor is ignored.
* ActivityInfo. SCREEN_ORIENTATION_USER:
* Use the current preferred direction of your device.
* ActivityInfo. SCREEN_ORIENTATION_BEHIND:
* Always keep the same direction as the screen, no matter whether the Activity is in the foreground or background.
* ActivityInfo. SCREEN_ORIENTATION_SENSOR:
* The Activity direction is determined by the physical direction sensor and displayed in the direction of the user's rotating device.
* ActivityInfo. SCREEN_ORIENTATION_NOSENSOR:
* Always ignore the orientation sensor's judgment. When the user rotates the device, the display does not rotate.
* ActivityInfo. SCREEN_ORIENTATION_SENSOR_LANDSCAPE:
* You want the Activity to be displayed on the horizontal screen, but you can change it according to the direction indicated by the Direction sensor.
* ActivityInfo. SCREEN_ORIENTATION_SENSOR_PORTRAIT:
* You want the Activity to be displayed on the portrait screen, but you can change it according to the direction indicated by the Direction sensor.
* ActivityInfo. SCREEN_ORIENTATION_REVERSE_LANDSCAPE:
* You want the Activity to be displayed on the horizontal screen, but it is opposite to the normal horizontal screen.
* ActivityInfo. SCREEN_ORIENTATION_REVERSE_PORTRAIT:
* You want the Activity to be displayed on the portrait screen, but it is opposite to the normal portrait screen.
* ActivityInfo. SCREEN_ORIENTATION_FULL_SENSOR:... the remaining full text>