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 / Is this how I should be handling resolutions?

Author
Message
wargasmic
17
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 3rd Jun 2013 21:09
I want my game to run fullscreen with no black borders and no stretching on every possible resolution.

My max target resolution if for the Ipad retina display at 2048x1566 so is it correct to set the virtual resolution to this then agk can scale it down on lower resolution devices?

Does setting the virtual resolution to 2048x1566 mean that the game will still render at this resolution for lower resolution devices causing possible performance issues or is it handled in the background so that only the required amount of pixels are rendered?

Having the virtual resolution at 2048x1566 and testing on my PC which is 1920x1080, there are no black borders and I'm guessing this is because the game is in 3d, because I'm also using sprites for the user interface but they are positioned as if there are black borders on the screen.

So basically 3d parts of my game seem to be drawn fine, but 2 parts(sprites, text) seem to be drawn as if there are blackborders.

Am i taking the correct approach? Is there any way to have the sprites draw to the same portion of the screen as the 3d stuff?
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 3rd Jun 2013 21:34
The black borders may still appear on other devices.

If the ratio of the height to width on the device is different from the ratio of your app resolution, there is the potential for black borders.

The 3D stuff works because AppGameKit doesn't currently cull 3D stuff that should not be displayed based on the resolution set in the app. It is something similar to the technique described below.

I am avoiding the black borders by using the command SetScissor(0,0,0,0) and displaying a sprite that is larger than my target resolution. The sprite is centered in the app and set as the furthest back (highest depth value) and it fills the black bars on everything I've tested.

You can even use the black bar space. I set one of my displays (showing score stats) to use all available device space by adjusting my text field location and size.

Potentially, depending on your app, you can even use all the space in whatever your app does.

In my case that won't work because I have to build levels for the game play. In game play I have another animated sprite that is over sized and shows an out of limits sort of image so that the player knows if they are to avoid that space. And it is necessary to account for the black bar space because some of the fields don't have active borders to stop a player and they can bounce into the out of limits space. As long as the sprite is still within the limits of the actual device and you don't do anything in your code to 'catch' it when it goes out of limits, it will display and have physics act on it.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master

Login to post a reply

Server time is: 2024-05-02 20:32:49
Your offset time is: 2024-05-02 20:32:49