HUD elements placement regardless screen type

Blitz3D Forums/Blitz3D Programming/HUD elements placement regardless screen type

Naughty Alien(Posted 2008) [#1]
..this really driving me crazy..if I set things properly that all HUD elements are on right place for all resolutions supported on my 16:9 monitor, then everything gets screwed on 4:3 and i guess pretty much any other ratio...I did search archive but couldnt find anything about this issue...does anyone have already working math behind this issue, for proper placement and scale of all HUG elements regardless aspect ratio or screen size...I'll appreciate help a lot..and main reason why im not using any GUI lib is simply because scale of given hud elements has been changed while position is fine..but im trying to get working scale too so all elements has same shape no matter what monitor size or ratio is used...


Stevie G(Posted 2008) [#2]

I believe that the GUI can run on a graphics resolution such as 640x480x32 which is a common place for all systems. It is not necessary to run on the same resolution as the main game unless there are special reasons.



Strange that your advice doesn't work on this occasion.

Is your hud made from images or quads/sprites?


Naughty Alien(Posted 2008) [#3]
>I believe that the GUI can run on a graphics resolution such as 640x480x32 which is a common place for all systems. It is not necessary to run on the same resolution as the main game unless there are special reasons.<
I cant remember I said this??

Anyway, it is made out of images, or better say with use of fastImage Lib..Positioning working well on 4:3 or 16:9 but somehow i cant get scale properly on 4:3 (initial set up was on 16:9)..


Stevie G(Posted 2008) [#4]
Well for 16:9 the aspect ratio is 9/16 = .5625 whereas for 4:3 the aspect ratio is 3/4 = .75

So, assuming you want the hud items to be smaller on the smaller resolution, the scaling factor which you should use ( assuming x+y ) are scaled uniformly is .5625 / .75 = .75

Stevie


Sir Gak(Posted 2008) [#5]
Why not have two separate sets of images for your HUD, one for the 4:3 and one for the 16:9? Moreover, you can have a Games Options menu where the user can set which resolution he's running under, so that your game can use the correct set of images.