Widescreen with Swift GUI system

Blitz3D Forums/Blitz3D Userlibs/Widescreen with Swift GUI system

Dock(Posted 2007) [#1]
I'm using the Swift GUI system for my game, but I have some questions about screen proportions.

Given that the system uses a 640x480 dimension for placement of sprites, and dimensions of images, how would you recommend I compensate for wide-screen displays?


sswift(Posted 2007) [#2]
That all depends on how you want the game to look on a widescreen display.

You could simply do nothing. Then the game will automatically stretch to fill the display. This is the easiest solution.

Also, unless you're doing a whole 2D game using the GUI system, then you could use a wider FOV for the game on widerscreen displays, but do nothing to the hud. Again, it will be distorted and fill the screen. This is the second easiest solution.

A harder solution would be to adjust the scale of the hud objects to keep things in the correct aspect ratio, but this requires you to have two versions of your HUD, with the placement and spacing of the hud objects being somewhat different. Ie, if you have a data display on the left and a radar on the right, they'd be farther apart on the widescreen version.

To do this scaling you can just use the scaleobject command, and set the scale to whatever makes the object have the right aspect ratio at that widescreen resolution. If you play around with the math in the GUI_CorrectCameraFOV(ThisCamera) function then you should be able to figure out how to calculate this scaling factor.

I think the above will work with fonts too. So, I dunno how much wider widescreen is than a regular screen, but if it's like 1.5 then you'd need to set the X scale of each object to 1/1.5 which is 0.66. That would make the objects narrower at 640x480, but the correct width at 960x480 or whatever you have for widescreen.


Dock(Posted 2007) [#3]
Oh, excellent, this seems to be the right track! Thanks for the help. My previous attempts involved scaling each object, but this would fall apart things if I rotated an object.