Resolution switching

Howdy all. I have a general question (as I’m fairly new to game development) about resolution switching. My game is designed to run mostly in full screen mode at resolutions of 1024x764, 1280x1024 and 1600x1200. I’ve finalized (I hope) the gui design and the graphics are created at 1600x1200 and I guess you could call that my native resolution.



What I do is that when a user goes into the options and selects a new resolution, I recreateWindow at the new res and then setLocalScale on the stateNode to match the newly selected lower resolution. It downsizes all my graphics and positions of other UIObjects nicely for 1280x1024 (only a little dithering), but on 1024x768 the jaggies really appear bad and the text doesn’t look so great.



I’ve tried turning on anti-aliasing by setting display.setMinSamples(4) in my initSystem, but it doesn’t seem to help. So I’m wondering what techniques do you all usually use for supporting different resolutions? It seems like my only option is to make a cut of all the graphics in Photoshop for the different resolutions and then replace them across the board when a user switches to a different res. This seems like a bit of a programming nightmare and I just wanted to see if there was some slick solution that I’m missing?



Many thanks.

A lot of games will fix the scaling of the gui at a given ratio and then center that in the screen… so say your art work is created at 1600x1200, you have a ratio of 4:3… 1280x1024 is 5:4, so the gui would really be 1280x960, with either black trim or see through to scene on the top and bottom of 32 pixels each. That will help also with widescreen aspect screens.



Another option is to use relative positioning, similar to a GridBagLayout or something like that in Swing, which would position your GUI items using screen width/height percentages.



Finally, the jaggies could be an issue with the mipmap generation/min_filter you are using. Try checking that and also make sure you are not using texture compression.



Hope that helps!

Renase, you are da man! :smiley:



I should’ve thought about mip mapping. Doah! That was it, switched it to linear and it’s perfect. Thanks so much.



Yeah, I was debating on which resolutions to support and I noticed that a lot of LCD monitors use 1280x1024 rather than 1280x960. Why? Who knows, but now supporting multiple modes is really a snap. With the resolutions out of the 4:3 ratio, it just stretches things a tad. Oh well. :stuck_out_tongue:

If you look at the resolution of various notebook tfts, you can easily see, that they have even stranger ratios than 4:3 or 5:4. I recall a Toshiba notebook having 8:5. Therefore I think it could be a good idea to have a HUD relative to the screen corners, ie. upper left, upper right etc.