Jump to content
  • Advertisement
Sign in to follow this  
Vile V

Resolution with a 2D Game

This topic is 2594 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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


Share this post


Link to post
Share on other sites
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!