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 / aspect ratio or virtual resolution?

Author
Message
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 3rd Nov 2013 12:22
Hi.

I want make a project when run on other platforms with different resolution automatically match all sprites according to current resolution without decrease Sprites quality. but I don't know Which is better? (aspect ratio or virtual resolution) I read Display document:
http://www.appgamekit.com/documentation/guides/0_display.htm

but I can't good understand different Between These two.
Please Guide Me.

Thanks.
Juande
12
Years of Service
User Offline
Joined: 2nd Sep 2011
Location:
Posted: 3rd Nov 2013 12:46 Edited at: 3rd Nov 2013 12:49
Hi,

I don\'t understand what you want to do... but, if you modify the resolution, your sprites will be seen bigger or smaller (the quality of the sprite is the same, for example 64 px).

On the other hand,

Aspect ratio is used to set the position in screen percentage. For example, my sprite will be on 20% of screen width and 20% of screen height.
Virtual resolution is used to set the position (of the sprite) in pixels: my sprite will be on 300 px of width and 200 px of hegiht.


In both case, you need set the device width and height (in setup.agc file)

If you want to use diferent resolutions, you need sprites with different sizes. Other option is to use zoom commands to get the same aspect with different resolution (but the quality will be lower) or to use 3d commands (3d world is confortable when you use different resolutions and you want the same aspect).
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 3rd Nov 2013 15:14
Thanks for Reply.

Quote: "If you want to use diferent resolutions, you need sprites with different sizes"


how can use this method?

your mean is for every resolution I should make a game?
(for e.g: assume my device is Sony with android OS and 320 x 480 screen resolution.Now if i want run it in other Sony Device with resolution 640 x 960 I should make another game with 800 x 600 resolution?)

Thanks
Juande
12
Years of Service
User Offline
Joined: 2nd Sep 2011
Location:
Posted: 3rd Nov 2013 17:00
Not neccesary. I think you are confusing the concepts.

The device resolution is different to virtual resolution.

Each device has a diferent resoltuion, but you don't have to build a game for each one... for this reason you have the virtual resolution command.

Imagine, your game will be 320x480 (virtual resolution) and the device resolution (setup.agc file) will be width and height device. You will place your sprites using your virtual resolution. Now, your device is 640x960... the device will use a virtual resolution 320x480 (it's like as full-screen in windows... the resolution of the windows is 320x480 but you are using full-screen). If you use a virtual resolution 640x960, your device (with 320x480) will rescale the image.

On other hand, you can create different version for different mobile (HD or SD)... one version with small sprites and another version with big sprites.
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 3rd Nov 2013 20:08 Edited at: 3rd Nov 2013 20:14
Quote: "Not neccesary. I think you are confusing the concepts."


Thanks for your explanation but really I Confused.I few understand but still I Confuse.
can you explanation with my ask?:
if screen resolution in setup.agc is 640 x 960. and in the game used SetVirtualResolution (1024, 768). how work it?

Please Help Me to understand this issue.

Quote: "On other hand, you can create different version for different mobile (HD or SD)"


What is HD and SD resolution range?

THANKS A LOT
Juande
12
Years of Service
User Offline
Joined: 2nd Sep 2011
Location:
Posted: 3rd Nov 2013 21:54
Your virtual screen (1024x768) will be scaled...

In paint... if you select a big resolution... for example 2048x1600 (This would be your virtual resolution), you wouldn't be able to see all the image, because your screen will be 1024x768 or similar resolution. But, in paint, you can use the zoom and scale the image (it's similar in your example). In your example, there is a problem... the aspect ratio is different. For this reason, you will have two black zones (similar to the black bands of the movies, if you wath a panoramic movie in a letter box TV)

Look this
http://developer.android.com/guide/practices/screens_support.html
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 4th Nov 2013 07:40 Edited at: 4th Nov 2013 07:41
I think understood. mean my virtual resolution can scale screen resolution to other device with different resolution until maximum (1024 x 768) width and height.right?
and other question is, screen resolution in (setup.agc) must same with virtual resolution? (mean if screen resolution in (setup.agc) is 1024 x 768 must virtual resolution have a 1024 x 768 resolution?)

if you answer this questions I think can good understand this issue.

Thnaks and Sorry for taking your time.
Marl
12
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 4th Nov 2013 11:21
Quote: "screen resolution in (setup.agc) must same with virtual resolution? "

No, the resolution in setup.agc is used on the PC and MAC to set the resolution when the app runs on these. It is the equivalent of the physical resolution on mobile devices.

If you use the commands getDeviceWidth() and getDeviceHeight(), on mobile devices they will return the physical resolution of the device, and on the PC and MAC they will return the values from setup.agc.

In all cases these values are considered the physical resolution.

Virtual resolution is totally independent of these - it can be the same, but does not have to be. AppGameKit scales the Virtual resolution for you.

SO if you set virtual resolution to 640x480 (Landscape);

- point 639,479 will be the bottom right corner
- point 320,240 will be the middle of the screen
- there will be 640 pixels across the screen and 480 down

On any device you use - no matter what the physical resolution of that device is.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 4th Nov 2013 15:09
One of the benefits of using Virtual Resolution is that you don't have to worry about how your graphics will display. AppGameKit will always keep the correct ratio on the device, using the maximum available and putting black bars either on the sides or above/below if the aspect ratio of the device is different from the virtual resolution.

And, there is a way to make sure that the black bars are not black bars using the SetScissor(0,0,0,0) command and pasting an oversized sprite (which can even be animated) centered in the display.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 4th Nov 2013 19:03
I prefer to use the percentage system so that I don't have black bars. It is probably more work, but if you want to guarantee that your app fills the screen you've got extra work.

Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 4th Nov 2013 19:55
OK. Thanks
I should more study about screen resolutions and make some small work for better understand.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 4th Nov 2013 20:13
I am using Virtual Resolution and some a single call to SetScissor, and two over sized background sprites (one of which is animated) to deal with the bars. There are no black bars at all on any device I run it on.

I find it easier to think in absolute pixel points instead of trying to work with percentages. And I know that my graphics will look the same on everything. The text is a little bit affected on a device with less physical resolution than my app is trying for. But it still works and behaves the same as on the target sized device and devices with larger physical resolutions.

Remember that some commands do not go together. If you use SetVirtualResolution, then you don't use SetDisplayAspect. SetDisplayAspect is only used with the default percentage system.

If you do use the percentage system, I think it is important to use the SetDisplayAspect command pretty much at the start so that none of your sprites get distorted.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master

Login to post a reply

Server time is: 2024-05-20 07:35:52
Your offset time is: 2024-05-20 07:35:52