How to handle different acpect ratios / monitor sizes / resolutions
I launched my first game, and it works as expected. I have learned a lot from this, and the next game will be better in some regards. But there are some things I could not fix, and maybe you can help me.
I set the window size of my game to 1600×900 so it has a 16:9 aspect ratio. When you switch to full screen and have a 16:9 aspect ratio screen, everything is fine.
But if you have an ultra-wide monitor or use your monitor vertically, I get black bars. Now my UI moves into these black spaces because I use display_set_gui_maximise()
But I would like to show more of the game without stretching it.
How can I increase the camera or viewport to match the screen when switching from windowed 16:9 to fullscreen, whatever size?
I tried a few things, but the result was not what I expected. Mostly it stretches everything. Like
Game Options or
camera_set_view_size(camera_get_active(), display_get_width(), display_get_height());