A game that I’m working on is set at 640x360. For the desktop version, I allow the user to double or triple the size of the window. This can be done easily by using Stage.nativeWindow.width and Stage.nativeWindow.height. I don’t have to worry about scaling since everything scales up to fill the entire window when the resizing occurs.
I’m having difficulty figuring out how to scale this 640x360 game to fill the entire screen of a mobile device. There is no option in copyPixels that allows me to scale before blitting, so if I wanted to resize my game to fill the screen on a phone, I believe that my best bet would be to manually scale everything to fill the screen while keeping the aspect ratio intact.
640x360 is a 16:9 aspect ratio. My Nexus 4 lies somewhere between 15:9 and 16:9. So, if I scale my game to fill the Nexus’ screen, it would end up being a little wide. To center it, everything would have to be moved a bit to the left (the sides would be cut off, which is fine).
Is there a way to manually control the built-in scaling system (the one used to automatically resize everything in the desktop version) to resize everything according to a scale that I calculate and then center everything on the screen?
Is what I am trying to do even possible, or should I be taking a different approach?