Screen Ratio

Blitz3D Forums/Blitz3D Programming/Screen Ratio

Naughty Alien(Posted 2008) [#1]
..im having problem with setting up scale factor for sprites, or HUD images I use..I mean..position non dependant to resoultion is fine as well as scale factors, long as its runing on non wide screen monitors..on widescreen positioning are correct but HUD elements are distorted..again, once I set it up for widescreen, its suck on non widescreen monitors..especially, if I set up for example 1280x1024 on widescreen, same things happen..I understand that ratio is an issue..but does anyone have some small piece of code, working in both situations?


_33(Posted 2008) [#2]
What does your HUD consist of? How does it look, could you poste a screenshot?


Gabriel(Posted 2008) [#3]
You'll want to manipulate the projection matrix if you want to keep your HUD elements consistent across different screen aspect ratios. I don't know if anyone's written anything to manipulate the projection matrix in B3D though. Possibly one of Tom Speed's DLL's?

With that you can simply set the aspect ratio to whatever you want ( widescreen or standard ) and then leave the unused area black. You can still scale so that you fill as much of the screen as possible. So essentially it's like watching a widescreen movie on a standard tv or vice versa.


Naughty Alien(Posted 2008) [#4]
@ _33
Basically Im going to set up elements what are pretty much rounded (circular) shapes..so what im doing is playing with one circle in the middle of the screen and trying to make it work on both, widescreen and normal monitors..or better say in all possible situations..

How to detect aspect ratio from code? By use GfxMode3DExists and check for one of widescreen resolutions supported or..??


Naughty Alien(Posted 2008) [#5]
..okay..I make it work and its great :) finally on both 1.3 and 1.6 working just fine...


_33(Posted 2008) [#6]
yes, you get the aspect ratio from simple math, and figure out how you locate / split / arrange your graphics according to that. But it sounds simpler sometimes than it actually is... Movie directors usually make sure that when they record their movies with the actors, that they can still make use of a 4:3 resolution on the movie without it looking too funny. But, with the new screens in 16:9, I guess their jobs are becoming easier ;) Superwide 2.35:1 is pretty wide compared to 4:3 !
http://en.wikipedia.org/wiki/Aspect_ratio_%28image%29
http://en.wikipedia.org/wiki/Letterbox