I want to change the resolution of my "view of the game" mid-game from 1920x1080 (landscape) to 1080x1920 (portrait). The window should remain whatever size it was but different scaling should occur so that all content is visible on the screen.
I made different layouts for landscape and portrait by detecting orientation and changing positions of nodes in the code. This is ok cos I don't have that many nodes.
The aspects of these layouts are 16:9 and 9:16 and I want to display them entirely so that nothing will be cropped. Added whitespace or black bars are ok.
I followed the instructions of this multiple resolutions tutorial and made my viewport a square 1080x1080. But I'm unable to make it work with any of the aspect settings.
"Keep" just forces the 1080x1080 square to be all that's showing.
"Expand" works only if the screen is high enough for portrait and wide enough for landscape. It will crop the content if the screen is portrait but not high enough or landscape but not wide enough. That's not good!
I managed to get the correct behaviour with use of Camera2D and a bit of code to adjust the zoom. I was almost excited .....until I realised it ruins the scaling quality and text will start looking bad.
The same can be done with the following code by changing the resolution to 1920x1080 when the screen is landscape and to 1080x1920 when portrait. But this ruins the scaling quality as well which doesn't even make any sense!
So what I'm looking for is a way to change the "visible area" of the game. Normally I would call that "viewport" but any adjustments to the viewport in code will change the window size as well. So if viewport = window, what is the "visible area of the game whera all content exists" called and how to change its size mid-game?