Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [BUG] SetImmersiveMode doesn't work correctly for all cases

Author
Message
Alex_Peres
AGK Master
14
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 16th Feb 2017 16:34
SetImmersiveMode doesn't work correctly for all cases.
The incorrect case:
1.Run game on Android 4.4+ with SetImmersiveMode(1).
2.Press VolumeUp or VolumeDown button.
3.The game changes its resolution (shows black borders).
4.Volume bar has disappeared but Immersive Mode is gone forever and the game remained with black borders.

The other games (compiled not with AGK) don't change the screen resolution when the volume buttons was pressed.
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 21st Feb 2017 15:31
If the OS turns off immersive mode at any time then the app returns to non-immersive mode size so that it is not covered by the nav bar, which might make some part of the app inaccessible to touch events. You can use SetImmersiveMode to turn it back on after the event to see if the OS will let you go back to full size. You can detect a screen size change by checking the GetDeviceWidth and GetDeviceHeight commands at regular intervals.
Alex_Peres
AGK Master
14
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 21st Feb 2017 16:42 Edited at: 21st Feb 2017 19:18
Thank you Paul! It works!!!
This needs to be added to documentation.

Login to post a reply

Server time is: 2024-04-19 19:57:23
Your offset time is: 2024-04-19 19:57:23