Resolution mismatch

Hello, so i encountered a problem when using

render.get_window_width()
render.get_window_height()

so when i try to print out these values when using “Samsung Galaxy Tab S2” i get resolution value of 1152x1536 while the original is 1536x2048. I’m putting 2 screenshots below one from defold while using code from above and the other is one is from Unity build.

Hmm, what values do you have in game.project? When do you call render.get_window_width() and render.get_window_height() and pass those values on to another script? In the init() function in the render script or every frame?

in game project i have 1080 width and 1920 height i checked this on ipad mini 2 and everything seems to be working. So i call these functions in render script init and then pass to gui script nodes.

I have a similar problem with Huawei P6. Its resolutions is 1280x720 but render.get_real_width() said that it is 1196x720. I think it happens because there are on-screen navigation buttons:


But even if I hide them, render.get_real_width() returns the same.

Yes, it looks like it works that way, but disappearence of ~1k pixels isn’t normal :D, they can’t be gone because of lower bar :smiley:

I seemed to recall running in to this problem myself a while back. After some digging I found this:

https://code.google.com/p/android/issues/detail?id=219133

Apparently an issue in Android 6 and 7 that has not been fixed yet. The height of the status bar (or nav. buttons bar?) gets subtracted from the display height in some instances :frowning:

God only knows how, but it works fine in other bugs, but still weird experience :smiley:

1 Like

@spycer.lviv, how did you hide the navigation buttons?!?!?!

There is arrow button like this:

could we have a little more information? previously we have spent some time wondering about how to make the navigation bar disappear.

thank you.

And with the last build it broke down again -_-. Just one weird thing, that other devices output right info, except for galaxy tab s2 which is very weird…