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 to use virtual resolution on all devices to be the same ?

Author
Message
haliop
User Banned
Posted: 2nd May 2014 12:41
what i mean is
im currently experemnting
with set virtual resolution according to vars i get



and the following commands of sprites for example
are like this


this way it will look about the same on all devices
but the problem im having is with Scissors , if i do

some devices will show more open space then others
how can i make it so all will look the same ?


thank you for ur help and time.
nadav.

Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 2nd May 2014 16:20
I'm not sure that's the best way to handle virtual resolutions.

I would just set the virtual res to say, 1024x600 and code the game around that. This would ensure that 1024x600 is the actual running resolution as far as your concerned, and that would be scaled to whatever you have setup, then scaled again to suit the actual device.

So, if you set the virtual res to 1024x600, set the display aspect to 1024.0/600.0, and set the setup width and height to 1024x600 - then all you need to do is program your game for that resolution, and it'll be scaled to suit whatever device your running on... except windowed PC of course, which would run at 1024x600.

I am the one who knocks...
haliop
User Banned
Posted: 2nd May 2014 16:43
im sorry but i dont understand
if i use 1024x600 every device will be scaled to this ?
what if a device cant handle this resolution ?
what if i want each device to work on its native resolution ...

Zwarteziel
15
Years of Service
User Offline
Joined: 22nd Jan 2011
Location: Netherlands
Posted: 2nd May 2014 17:07
@Haliop,

it's a virtual resolution, so it is used 'internally' (e.g. in your program and your calculations), while your device runs at a different resolution.
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 2nd May 2014 17:59
A device will automatically run in it's native res, no matter what you set as the virtual resolution. The resolution stuff really affects PC much more than anything else - but at least the setup.agc file can be modified by the end user to suit the resolution.

I would usually just set the res in the setup file to suit the virtual res, just so that it maintains the same aspect ratio - but the device will actually be full screen and automatically scaled to it's native resolution.

I am the one who knocks...
Ancient Lady
Valued Member
22
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 3rd May 2014 21:17
Quote: "what if a device cant handle this resolution ?"

Then AppGameKit scales everything down.

I've been testing my WIP on devices with a range of resolutions, including one poor thing with has a much smaller resolution. It still works and the only thing that appeared to suffer was the text displayed.

Quote: "if you set the virtual res to 1024x600, set the display aspect to 1024.0/600.0,"

The display aspect commands are for when you are using the percentage system. They are not used when doing the virtual resolution.

In the event that the ratio of your target resolution means that the display area is either shorter or narrower than the actual device (it will always be filled in one direction or the other), there will be black bars above/below or left/right.

This can be handled by using the SetScissor(0,0) command and then having your background sprite oversized to fill the black bars and centered in the display.

You can even draw other things in the black bar areas as long as you realize that they may not be visible if a device has a display ratio the same as generated by your virtual resolution.

I prefer using virtual resolution because it allows you pixel perfect control of the display.

As Van B says, it is probably better to go with the virtual resolution and then code your game and size your images appropriately.

Cheers,
Ancient Lady
Naphier
15
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 3rd May 2014 22:27
I prefer percentage system. I still have pixel perfect control (pxW# = 100.0/GetDeviceWidth() and pxH# = 100.0 / GetDeviceHeight())
I don't have to worry about filling the backgrounds as positioning is all based on "what fits" sort of scenario. The games look great on all devices. I've seen quite a few virtual res games that look quite odd because you can tell the bg is getting filled. It's most apparent when you design for 16:9 and are looking at it on 3:2, otherwise it is bearable, but I've also seen a few cases where the device resolution is high and it makes all of the sprites look very small. I think DanielTGC's space game example did this.
A lot of it is up to personal preference, but I've found it is best for me to work in the percentage based system. I might change my mind if AppGameKit has a GetPixelDensity command, though.

Login to post a reply

Server time is: 2026-07-28 02:48:09
Your offset time is: 2026-07-28 02:48:09