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?
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 methods Display.getHeight
and Display.getWidth
. From the docs: This value is adjusted for you based on the current rotation of the display.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With