test my aspect ratio keeper thingy.

Community Forums/Showcase/test my aspect ratio keeper thingy.

coffeedotbean(Posted 2007) [#1]
I have a widescreen monitor that by default streches any 4:3 display.. thats not good for making indie games, scretched games look ugly and you cannot ask a player to change their gfx settings.

So the only other way to do this is to scale the game to keep the 4:3 aspec but you will get black bar down the side which is better then a streched display.

Ok I believe what I have done is some kind of projection matrix but I realy dont know.

Heres the download, it includes the exe. and bmx. should you want to see the code, ignore most of it as its just a little game im working on and is very untidy. But it shows that mouse corrds still work even on a scaled display.

Note this program should not blow up your monitor the 2 display modes it uses are either your desktop resolution or a 640x480 resolution.

So what will the program do? it will launch using your desktop resolution and will scale all gfx and mouse operations so that the game maintians it 4:3 aspect (640x480) the trade off is black bars either side. the 2nd display is without scaling and will run the game in 640x480.

If you widescreen scretches normal 4:3 aspect you should see a 4:3 aspect on display 1 with black bars, the 2nd dosplay you should see your normal streched display.

heres the download: http://www.getperplexed.com/aspect_test.zip

please report what display you have 4:3 12:10 12:9 and what happened on both display modes.


Boiled Sweets(Posted 2007) [#2]

and you cannot ask a player to change their gfx



Why not? I detect their current desktop resolution and prompt them auto selecting the detected resolution so they just have to hit "GO" or they can change their resolution.

Sounds like you are over complicating things. My last project supports 800 * 600, 1024 * 768, 1280 * 1024, 1440 * 900 and 1680 * 1050 (4:3, 5:4 and 16:10) resolutions (ratios)


coffeedotbean(Posted 2007) [#3]
I mean go into their gfx card settings and set their monitor/card not to strech non-widscreen modes.

No offense but I dont think you know what im banging on about =S

I want my game to run in 640x480 but my widescreen streches the game to fill all the screen, this is ugly, so I have no choice other than to use a square pixle resolution such as 1400x900 but when I do that the game is tiny, so i have to scale the game to fill the height of the screen but im left with black bars on eitherside.. but at least its not scretched.

I can turn off streching in my gfx settings, but the average casual gamer wont have a clue or would want to do this, so I need a solution.

the idea is to show a user a test card the fist time the game starts, this is show a circle and a square I will ask 1 question "does the square and circle appear streched" if they say no then I know that either have a 4:3 display or a widescreen that does not strech 4:3 displays I can then simply run the game in 640x480, if they press yes I know they have a widescreen that streches 4:3 displays and I will offer the choice to use some aspect correction.


Matty(Posted 2007) [#4]
On my 1280x1024 display both modes did not fit the text fully on the screen. The graphics looked much the same but the text did not fit on the screen (ran off the left and right hand sides).


xlsior(Posted 2007) [#5]
On my non-widescreen display, your testapp prints the text incorrectly in 'stretched' mode.

The graphics all look identical (as expected), but the text starts outside of the left side of the screen, making it partially unreadable.


coffeedotbean(Posted 2007) [#6]
ah yes the text will over run the screen.. should of mentioned that, but what your saying is on your non-widscreen displays both modes show as you would expect?

*EDIT* hold on your guys said text ran off the left side? even on on non-streched mode? where the game runs in 640x480 with no correction?

Now I just need a few people with widescreens to test it out.


xlsior(Posted 2007) [#7]
*EDIT* hold on your guys said text ran off the left side? even on on non-streched mode? where the game runs in 640x480 with no correction


No -- in non-stretched mode it runs off the right side.

In stretched mode it runs off both sides.

The graphics look identical in both modes.


BlitzSupport(Posted 2007) [#8]
It keeps the 4:3 aspect ratio in both modes on my non-widescreen monitor.

I was attempting something similar recently (again with the thought that a game written for 640 x 480 would look bad on a fixed-resolution/widescreen TFT display). Also, I'd fill in the black bars with a muted pattern, eg. pale blue checks like at the start of the 'Max RockOut sample. Yours looks a lot simpler though!

Substitute "boing.png" with your own image (fairly small, ie. <= 256 x 256) -- not tested much! I just got the basics going:




coffeedotbean(Posted 2007) [#9]
Not sure if this is supposed to work on widescreen... but... on my widescreen if i pick an actual screen of 1440x900 (widsecreen) it displays as 4:3 but its too big, seems the height doesnt scale correctly.

I am goona borrow my friends crap-tastic PC on the weekend has a 15" 4:3 and dated on board gfx, I need to see if scaling works correctly and more importantly if his onboard gfx wont have a slow down from a scaled display.