So my game starts in Vertical orientation and then eventually goes to Horizontal orientation. I know that the width of the screen is the width of the screen and the same with height when it is in Vertical orientation. When it switches to Horizontal orientation does the Height become the Width and the Width becomes the Height? Or do they stay the same?
So my game starts in Vertical orientation and then eventually goes to Horizontal orientation.
Share
Yes the screen width and height change depending on the device orientation. You can get the size of a display with
Display.getSize(Point outSize)which is a replacement for the deprecated methodsDisplay.getHeightandDisplay.getWidth. From the docs: This value is adjusted for you based on the current rotation of the display.