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 / Problem with device orientation and screen resolution.

Author
Message
Zigi
14
Years of Service
User Offline
Joined: 5th Jul 2009
Location:
Posted: 25th Sep 2016 09:03 Edited at: 25th Sep 2016 09:13
Hi.

I'm experiencing a problem with device orientation and screen resolution but I'm not sure how to solve this problem.

What I do, I set the window size to 1280x800 and the resolution to the same and I set the resolution mode to 0 which is "scale". So If I'm correct even if the resolution of the device is smaller or bigger than 1280x800 the screen should be scaled to the resolution of the device.
But I want to allow only landscape orientation on mobile devices so I have set the orientation allowed to landscape (0,0,1,1) and this is what I have problem with. If I hold my device in portrait orientation, the screen get scaled to the portrait resolution at start and then turned to landscape which is wrong because in landscape view the height of the screen is smaller (720) so I get the bottom off screen. If I hold the device in landscape orientation at start, it works but I would expect most people hold their mobile device in portrait view when start the app.

I have thought about to set the orientation manually or ask the user to turn the device to landscape orientation in case it is in portrait and start loading the game and set scale and resolution only if the device is in landscape orientation to avoid this bug but in AppGameKit doesn't seems like I can GetDeviceOrientation and SetDeviceOrientation manually.

Anyone could help me with this problem please. is there any solution at all, anything?
Thanks.
Zigi
14
Years of Service
User Offline
Joined: 5th Jul 2009
Location:
Posted: 25th Sep 2016 17:13
It seems like I have solved the problem by using the Sync() command right after I set the screen resolution, scale and orientation but before anything is loaded.
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 26th Sep 2016 11:30
Useful to know. Thanks!
V2 T1 (Mostly)
Phone Tap!
Uzmadesign

Login to post a reply

Server time is: 2024-04-25 11:18:19
Your offset time is: 2024-04-25 11:18:19