Ooops
April 08, 2020, 05:30:09 AM

Author Topic: Device width & height on mobiles  (Read 1358 times)

Offline muruba

  • Full Member
  • ***
  • Posts: 146
    • Ivelle Games
Device width & height on mobiles
« on: June 27, 2017, 08:36:15 AM »
I just noticed that for my android device width and height for landscape mode are actually reported as in portrait mode, is it true for any other devices (ios/android)?

So I have my game in landscape, but:

06-27 17:33:32.534 22977 23043 I [Monkey]: DeviceHeight: 1920
06-27 17:33:32.534 22977 23043 I [Monkey]: DeviceWidth: 1080

Offline MikeHart

  • Hero Member
  • *****
  • Posts: 651
Re: Device width & height on mobiles
« Reply #1 on: June 27, 2017, 09:42:58 AM »
I have to check this myself tonight. Which Monkey version do you use? " or X, if X, which version. What Android version and what device?

When do you retrieve these values? In OnCreate?

Offline muruba

  • Full Member
  • ***
  • Posts: 146
    • Ivelle Games
Re: Device width & height on mobiles
« Reply #2 on: June 27, 2017, 10:13:14 AM »
Thanks!

onCreate
Monkey 86e
galaxy s6 (Android version 7.0)

Offline MikeHart

  • Hero Member
  • *****
  • Posts: 651
Re: Device width & height on mobiles
« Reply #3 on: June 27, 2017, 10:21:32 AM »
When start the app , do you turn it to landscape?


Please try to retrieve the dimensions in OnUpdate to see if it makes any difference.

Offline muruba

  • Full Member
  • ***
  • Posts: 146
    • Ivelle Games
Re: Device width & height on mobiles
« Reply #4 on: June 27, 2017, 10:35:03 AM »
This is crazy but I can't replicate it any more.

Now it is showing:

06-27 19:29:40.909  3546  3581 I [Monkey]: DeviceHeight: 1080
06-27 19:29:40.909  3546  3581 I [Monkey]: DeviceWidth: 1920

every time I try rotating the device in all possible ways.

I also have:

android:screenOrientation="landscape"

Thanks!

Offline MikeHart

  • Hero Member
  • *****
  • Posts: 651
Re: Device width & height on mobiles
« Reply #5 on: June 27, 2017, 10:38:50 AM »
Back in the days I experienced this odd behaviour that the app on the device was not updated right away as I made changes. Maybe it was still running in the backround, i don't know.

Glad it is working for you now.

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal