smarthaert / phoenixlib

Automatically exported from code.google.com/p/phoenixlib
0 stars 0 forks source link

Screen Aspect Correction #66

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Well... I have been playing with setViewPort... and It looks like will solve a 
lot of problems... But I have some question and I do need some example if 
possible.... 

Well... My game default res is 1024x768... 4x3 aspect ratio... 

I want that if the Monitor Aspect Ratio is different from 4x3, it must set 
closest resolution possible to fit the 4x3 window on It, and so add some Image 
in the Left and Right margins when need. I want to avoid out of aspect ratio 
reescale and black borders.

By example :
My IMAC default Res is (1680x1050)... 1.6 aspect ratio... Phoenix must set the 
Resolution to (1280x768), that is the closet resolution to (1024x768) that 
Keeps the Aspect Ratio. And Add a Left and Right tiled Texture of 128 pixels.

My Notebook native res is (1280x800)... 1.6 aspect ration.... Phoenix must use 
this resolutin (1280x800), Reescale the ViewPort to Fill Vertically the Screen, 
and Add tiled textures to the border.

My Netbook native res is 1024x600... 1,7 aspect ration... Phoenix must use this 
resolution, scalling all down and keeping the vertical viewport to stay full 
screen, and again it will have to add tiled texture borders to it.

--------------
Well.... with some work, I can do it by hand by pre-calculing all the 
resolutions and setting the correct ViewPort. (But I don't know out to drae 
borders outside the viewport)

But how do you suggest to do this Easily? 

- Phoenix must use the closest to (1024x768) avaliable native resolution to the 
monitor.
- It must scale the viewport (1245x768) to fit this resolution, keeping the 
Vertical Viewport filling the full screen.
- It must draw some texture in the Black Horizontal Borders necessary to keep 
the ViewPort with Original Aspect Ratio.

Sorry for the long explanation! But what do you suggest?

-- This must only happens in FullScreen, in Windowed Mode the Only Scale need 
is if the Native Monitor Resolution is Smaller than the Game Resolution.

Original issue reported on code.google.com by wagenhei...@gmail.com on 20 Jul 2010 at 3:41

GoogleCodeExporter commented 9 years ago
Some info to Help:
http://forums.indiegamer.com/showthread.php?t=11265&highlight=viewport

Original comment by wagenhei...@gmail.com on 20 Jul 2010 at 3:49

GoogleCodeExporter commented 9 years ago
This is supported and you are on the correct path with SetViewPort, i will 
create a demo showing how to do it.

Original comment by andreas....@gmail.com on 13 Aug 2010 at 12:40

GoogleCodeExporter commented 9 years ago

Original comment by andreas....@gmail.com on 11 Nov 2010 at 7:58