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.

Newcomers AppGameKit Corner / [SOLVED] Screen orientation on a Android phone

Author
Message
Zaxxan
User Offline
Joined: 17th Nov 2020
Location: UK
Posted: 20th Dec 2020 06:16
Hi All, I am experimenting with the screen orientation on an android phone. I have got my card game rescaling when the screen is rotated and I change the SetVirtualResolution from landscape to (1920, 1080 ) to portrait (1080, 1920) by detecting the orientation of the phone. This works but sometimes you can actually see the background expand or shrink and sometimes it is very smooth. Is there a better way of doing this?

The author of this post has marked a post as an answer.

Go to answer

Zaxxan
User Offline
Joined: 17th Nov 2020
Location: UK
Posted: 21st Dec 2020 09:00
I have made some progress with this by making the sprites invisible when the orientation changes and then resizing and repositioning them while they are invisible. I then use 'if getdevicewidth>getdeviceheight' before making the sprites visible again. I now don't see the sprites resizing or moving but I sometimes get a slight delay before the sprites are made visible again.

I'm sure there must be a better way of doing this and I would be grateful for any advice as this is holding up my new project.
Zaxxan
User Offline
Joined: 17th Nov 2020
Location: UK
Posted: 1st Jan 2021 11:40
This post has been marked by the post author as the answer.
I've sorted this, it's easy when you know how!

Login to post a reply

Server time is: 2021-04-14 09:15:14
Your offset time is: 2021-04-14 09:15:14