Sign in to follow this  
Vile V

Resolution with a 2D Game

Recommended Posts

Vile V    100
I realize that this is an often asked question. But answers online are usually rather poor or unclear.
In a nutshell my problem is the following: The last feature my engine requires before I can begin with my game is full screen and also several resolutions. My game's native resolution is 1024X640 but I'd like to support several others. I realise scaling the image will result in poor results (unless the scaling is a 200% one for example, which'll just make the result twice as big.). I came across multiple methods but I do not know which is most often used in games.

Do I simply scale the sprites upon rendering depending on the resolution? Do I add black bars where necessary (more applicable to fullscreen really)? What resolution is most often used for 2D games? (I believe mine might be a bit high)

I realise my question is quite general, but I mostly just need advise on what the "best" approach is, or the most common practice when scaling 2D images.


Thank you in advance.

Share this post


Link to post
Share on other sites
freeworld    341
The easiest solution would be to render your game to a desired sized render target, then stretch that to the actual backbuffer. For different aspect ratios, ofcourse you're going to have to add some sort of filler for the extra space.

This is the way I do it for my projects. I do have a small fallback for times when I do want to support different resolutions without having to use letter boxing. I use what I call anchor points on the screen, Basically I split the resolution into a 3x3 grid, and every corner on that grid is a reference point I can used to arrange things like menus or HUD elements.

Share this post


Link to post
Share on other sites
Vile V    100
[quote name='freeworld' timestamp='1305496800' post='4811223']
The easiest solution would be to render your game to a desired sized render target, then stretch that to the actual backbuffer. For different aspect ratios, ofcourse you're going to have to add some sort of filler for the extra space.

This is the way I do it for my projects. I do have a small fallback for times when I do want to support different resolutions without having to use letter boxing. I use what I call anchor points on the screen, Basically I split the resolution into a 3x3 grid, and every corner on that grid is a reference point I can used to arrange things like menus or HUD elements.
[/quote]

Alright, I'll give this a try. Thank you for the quick response.

Share this post


Link to post
Share on other sites
DpakoH    1204
[quote name='Vile V' timestamp='1305536149' post='4811355']
[quote name='freeworld' timestamp='1305496800' post='4811223']
The easiest solution would be to render your game to a desired sized render target, then stretch that to the actual backbuffer. For different aspect ratios, ofcourse you're going to have to add some sort of filler for the extra space.

This is the way I do it for my projects. I do have a small fallback for times when I do want to support different resolutions without having to use letter boxing. I use what I call anchor points on the screen, Basically I split the resolution into a 3x3 grid, and every corner on that grid is a reference point I can used to arrange things like menus or HUD elements.
[/quote]

Alright, I'll give this a try. Thank you for the quick response.
[/quote]

check [url="http://www.david-amador.com/2010/03/xna-2d-independent-resolution-rendering/"]this[/url] out. if you do not understand it please feel free to ask, but i think you will be fine!


Share this post


Link to post
Share on other sites
SuperVGA    1132
I'm just wondering if XNA doesn't do this, or if changing the display mode is just too "last decade"? ;)
Obviously that specific resolution is a little odd, but its cousin 1024x768 can be used in many cases.

I understand that hardware enumeration is also a lot of work, and agree that independent, scaled images are much easier and portable.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this