Does the Width and Height change with orientation?

前端 未结 2 2023
滥情空心
滥情空心 2021-01-13 00:18

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 wit

相关标签:
2条回答
  • 2021-01-13 00:27

    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.

    0 讨论(0)
  • 2021-01-13 00:44

    wanted to add that on my tablet when running full screen apps it will run 1280 x 753 (not 800 because of the bottom bar). 753 is what is returned from getSize. When the orientation flips.. it's 1280px - 47px

    0 讨论(0)
提交回复
热议问题