blaswtf
blaswtf

Reputation: 91

Libgdx does not get the resolution correctly in Nexus 5

The screen resolution of the nexus 5 is 1920X1080, and Libgdx says it is 1794X1080. I'm using it in landscape mode, and libgdx is getting the height correct, but it reduces the width. I guess that is because is not counting the pixels of the navigation bar.

Is there any solution to make libgdx to detect the width including the navigation bar?

Upvotes: 0

Views: 361

Answers (1)

Alexander Mironov
Alexander Mironov

Reputation: 3102

If you just want to get real display resolution you should check this question. But I think you may want to run your application in real fullscreen mode. That's it, without navigation bar. Just set useImmersiveMode to true in your AndroidApplicationConfiguration.

You can Read about Android immersive mode here: http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/backends/android/AndroidApplicationConfiguration.html#useImmersiveMode

Upvotes: 1

Related Questions