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 / Landscape Mode for All Sizes?

Author
Message
2Beastmode4u
13
Years of Service
User Offline
Joined: 14th Feb 2011
Location: Loading...
Posted: 21st Jul 2015 04:02
Hello,

So I am having a bit of trouble with this. I am trying to have my app fit the screen in landscape more for all phones with the app.

Here is my code:


Cheers.

29 games
19
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 21st Jul 2015 12:59 Edited at: 21st Jul 2015 13:00
I use the SetVirtualResolution() command and then the SetScissor() to get rid of the black borders. I then use the GetScreenBoundsBottom() etc and save the extreme boundaries of the screen and position everything according this.

Or you can use the percentage based system.

I tend not to get too worried what the actual resolution of the devices screen is, other than to make sure that things are too illegible on low res screens.

Invaders of the 29th Dimension - available now on Google Play
Find me on indieDB
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 21st Jul 2015 13:31 Edited at: 21st Jul 2015 13:33
i would try to get the display aspect with GetDeviceWidth() & GetDeviceHeight()
then transform it
so 16:9 is SetVirtualResolution(160,90) (instead of 100x100) or SetVirtualResolution(1600,900)
+ limit to landscape only.
the gui must align itself if the screen is 4:3 or 1:1 ...
its between 0,0 and GetVirtualWidth,GetVirtualHeight

AGK 108 (B)19 + AppGameKit (Steam) V2 Beta .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
2Beastmode4u
13
Years of Service
User Offline
Joined: 14th Feb 2011
Location: Loading...
Posted: 22nd Jul 2015 19:59 Edited at: 22nd Jul 2015 23:19
I figured it out. The command sometimes didn't get height and width in the right mode so you have to double check it. This code works:



Now I'm wondering where I can get some 2D cartoon artists for my game.

Login to post a reply

Server time is: 2024-11-25 21:25:11
Your offset time is: 2024-11-25 21:25:11