Scaling for 16:9 resolutions
Posted: Wed Mar 11, 2020 9:02 am
I'm making a game that I want to always render in 16:9. I will have the window settings be controllable in the game so no maximize/resize buttons on the window itself. I want the game to fit on all screens, but have black borders on different aspect ratios. I also want to be able to scale the game properly. I was going to use percentages of the screen but there's too many fractions involved which can cause graphical problems in other resolutions.
Anways, I'm using a canvas. I need it to always be 16:9 and be able to scale. I've been working on and off on this for years and I used to just use the scale argument but it makes the code clunky but it's looking like thats the best option. I have no idea how to go about the 16:9 resolutions though. Any ideas? I will be porting this game to all platforms, Android/IOS/Mac/Windows and I'm using Linux.
Anways, I'm using a canvas. I need it to always be 16:9 and be able to scale. I've been working on and off on this for years and I used to just use the scale argument but it makes the code clunky but it's looking like thats the best option. I have no idea how to go about the 16:9 resolutions though. Any ideas? I will be porting this game to all platforms, Android/IOS/Mac/Windows and I'm using Linux.