Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Can you give me a quick tour for an application which has to work in different resolutions. It's a game, with lot's of graphics and images and effects. We are using C#. The game is simple 2D, looking like OGame but working like a desktop application. Our problem is how to make it compatible with different resolutions. What I expect you to give me is an advice - which technologies or combination of technologies and/or some basic tricks I should use to make my application work the same in different resolutions. Thank you!

share|improve this question
    
What library are you using? XNA? –  Wouter Sep 27 '11 at 13:57
1  
add comment

1 Answer

up vote 1 down vote accepted

What you can do is draw everything to a rendertarget with a nice resolution. Say 1280x720 (a lot of games use this resolution or lower on the consoles). You then get the texture from the rendertarget and stretch it over the entire screen (you might want to add Anti-Aliasing as a post process step when upscaling). When you you stretch the game to a non-widescreen resolution you should add black bars on the top and bottom.

This approach works fairly well, and is easy to implement. But if you want to support a very large set of (odd) resolutions (say 640x480 to 1920x1080) you have to make sure the text and everything is readable by testing the game at all resolutions. Btw don't use anti aliasing when downscaling as this will actually worsen the image.

share|improve this answer
    
Design different UIs based on aspect ratios, not resolutions. Creating different sizes for text and icons is relatively trivial. –  ChrisC Sep 27 '11 at 18:03
    
Thanks. This might work. I'll try. –  Itay Grudev Sep 27 '11 at 19:14
    
@CCRicers, designing 2 UIs is double the work, but might be doable. However when you start creating different sizes for text and icons means that you have to check an insane amount of combinations of text lengths, text sizes, etc... Depending on how stylistic your GUI is this can be quite a PITA. –  Roy T. Sep 28 '11 at 5:18
    
@Roy T. I am only basing my view on creating different text sizes based on your suggestion to not simply downscale big text with anti-aliasing. Though I'm not sure if you really mean using a linear filter? In my experience downscaling with a linear filter has always given acceptable results. –  ChrisC Sep 28 '11 at 16:45
    
@CCRicers tbh I hadn't thought much about downscaling. Using 720P as a baseline I usually only have to scale up. But a linear filter, or maybe other filter types too can probably help to keep text readable. –  Roy T. Sep 28 '11 at 20:32
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.