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 / SetDisplayAspect + aspect ratio

Author
Message
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 6th Jun 2013 20:49
Hello

I understand that SetDisplayAspect() can fix sprits look in different resolution. but I don't good understand what is aspect ratio and what mean 4:3.

Please Guide Me

THANKS
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 6th Jun 2013 21:27
This is only used if you are using the percentage display system.

The "aspect ratio" is the ratio of the width to the height. Very loosely, "4:3" means that for every 4 pixels of width there are 3 pixels of height.

A width of 1024 and a height of 768 is a 4:3 ratio. If you divided the width by 4 and then multiplied that by three, you get the height.

But in the percentage system you are not working with actual pixels, but with the percentage in the x and y direction that a point is at. And you only use values between 0 and 100 for indicating sizes and positions.

In the percentage system, SetSpritePosition(spr,50.0,50.0) would position the sprite in the middle of the display.

So, if you want to use the percentage system, you will want to use SetDisplayAspect to fit what your target size ratio is.

If you want to use exact pixel locations, then you use the virtual resolution system and don't use SetDisplayAspect at all.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 6th Jun 2013 21:36
Thanks I undestand aspect ratio.
but I don't know what is percentage display system.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 6th Jun 2013 22:14
I did explain that.

It means using a percentage value (0 to 100) to indicate a size or location instead of actual pixel values.

This help page discusses the two display systems.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 6th Jun 2013 22:34
Thanks Ancient Lady
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 6th Jun 2013 22:58
No problem.

Happy Programming!

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master

Login to post a reply

Server time is: 2024-05-03 04:00:36
Your offset time is: 2024-05-03 04:00:36