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 / How are width and height of actual versus virtual worked out

Author
Message
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 3rd Apr 2013 21:05
I am setting a virtual size for my WIP to go for iPhone (960 wide by 640 high).

Now, when this gets translated to my iPad (actual display 1280x720 in landscape), the app fills to the left and right and then the black bars (if they were visible, which they aren't because of oversized background) would appear at the top and bottom.

On my Samsung Galaxy III (1280x768) the black bars are on the left and right.

I want to adjust a particular display (player & leader board stats) to fill out and use the entire space.

So, I need to know how AppGameKit decides which direction to fill to and which to leave blank.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 3rd Apr 2013 21:51
I think it simply scales to maximum size that fits the entire game area. If the screen ratio is wider than your app the sides will be black and the opposite with a taller ratio.


Demo 3 is out now!
Grumpy Jedi
14
Years of Service
User Offline
Joined: 16th Jan 2010
Location:
Posted: 3rd Apr 2013 22:22
Hi  Ancient Lady,

Digital Awakening is exactly correct.

The resolution of the iPad is actually 1024x768 which makes it's aspect ratio 1.3

The aspect ratio of your project at 960x640 is 1.5

The aspect ratio of a device at 1280 x 768 is 1.6

So in order for AppGameKit to maintain the aspect ratio of your project on the iPad, it must add black bars above and below, because the screen ratio is taller than it is wide when compared to the aspect ratio of your project.

However on your other device the screen ratio is wider than it is tall when compared to your project, and therefore it must add bars to the left and right to maintain the proper aspect ratio.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 3rd Apr 2013 22:52
I know that is how it works.

What I am trying to figure out is how, within the AppGameKit logic, it decides that the black bars will be on the top and bottom or on the left and right.

And I had come to the conclusion that the black bars are on the left/right when the actual ratio is above the virtual ratio and on the top/bottom when it is the other way around.

I had initially put some incorrect values in when I was putting a grid together to see what happened.

Now, I need to work out the right way to calculate the area being blacked. It gets a bit more complicated when you consider a device with lower resolution where the ratio is different.

Thank you for your comments, this question is now 'answered' and moot.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 4th Apr 2013 23:04
i think about a borderless mode for my games but similar 100x100%
i don't like the black bars. it is a screen, why not use it too.
100x100% are allways visible and the rest is bonus.

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 4th Apr 2013 23:37
But I really don't want to work with the percentage system. It won't work well with my WIP.

I got rid of the black bars by having a background image big enough for all of the main display configurations and it displays past the edges.

Now, I use that extra space in my stats display.

This is the Tier 2 pseudo code for determining the extra space above/below/right/left:


Then you add the offsets to your baselines to get the actual X,Y for display. To get the leftmost X for a display that would have bars on the left/right, you simply set it to the_disp_ulX.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master

Login to post a reply

Server time is: 2024-11-24 11:28:36
Your offset time is: 2024-11-24 11:28:36