Resolution with a 2D Game

Started by
3 comments, last by SuperVGA 12 years, 11 months ago
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.
Advertisement
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.
[ dev journal ]
[ current projects' videos ]
[ Zolo Project ]
I'm not mean, I just like to get to the point.

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.


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

[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.


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

check this out. if you do not understand it please feel free to ask, but i think you will be fine!


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.

This topic is closed to new replies.

Advertisement