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 / Android Orientation issues

Author
Message
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 4th Dec 2011 13:52 Edited at: 4th Dec 2011 13:53
Hello, I've finally managed to get my game running on an Android device. (Sony Ericsson Experia x10i) and everything works great except the orientation of the screen.

I've done the calibration, no issues there, but even though I've set the game to run landscape only, it still insists is displaying in portrait, whilst the phone is landscape. (As in the image attached)

Any ideas on how I can fix it?

My signature is NOT a moderator plaything! Stop changing it!

Attachments

Login to view attachments
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 4th Dec 2011 14:06
I have no problems at all with my Galaxy S2. Are you using the correct virtual resolution? Here's what my settings looks like.

SetVirtualResolution( 800, 480 )
SetOrientationAllowed( 0, 0, 1, 1 )

Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 4th Dec 2011 14:08
Yes I am...

SetOrientationAllowed( 0, 0, 1, 1 )
SetVirtualResolution( 480, 320 )
SetDisplayAspect( ( GetDeviceWidth() + 0.0 ) / ( GetDeviceHeight() + 0.0 ) )

Perhaps it's the order in which I'm using it which is causing issues, I'll have a bit of a play.

My signature is NOT a moderator plaything! Stop changing it!
Impetus73
12
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 4th Dec 2011 14:21
Never use setvirtualresolution, and setdisplayaspect in the same program! use only one of them.

aspect is for percentage based resolution, virtual is for fixed resolutions.

----------------
AGK user - novice
Did Amiga / AMOS programming in the 90's, just started programming again with AGK.
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 4th Dec 2011 14:23
You don't need SetDisplayAspect() when using SetVirtualResolution(). Try without.

Since you are in landscape I think you have to switch the values in SetDisplayAspect(), the height of the phone becomes the width.

Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 4th Dec 2011 14:37
All good advice! I'll try it all now and see if it helps!

My signature is NOT a moderator plaything! Stop changing it!
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 4th Dec 2011 14:52
SUCCESS!!

I removed the aspect bit, and moved the resolution bit above the orientation bit and all's well with the world!!!

Thanks a bunch for your help!


I now have my first android game!!

My signature is NOT a moderator plaything! Stop changing it!

Login to post a reply

Server time is: 2024-05-04 13:19:26
Your offset time is: 2024-05-04 13:19:26