by Nuthen · 3y ago · 0 comments
If I just made the game at a fixed 16:9 ratio, it'd leave empty space at the edges of any window that isn't exactly 16:9. Same if I chose 16:10 or any fixed aspect ratio.
By supporting a range of ratios between 16:9 and 16:10, I maximize the number of window sizes that the game will display nicely in without any empty space (black bars) at the sides.
The best way, I thought, to support a range of aspect ratios was to define two rectangles in the scene, having the minimum and maximum ratios supported, and interpolate the camera rectangle between them.
Hope that makes sense!