Maximizing object space without streaching or forcing an aspect ratio

Just set width and height to min(screen.width, screen.height), it will have the object centered as a square filling up the most amount of space it can. If you want to instead get a rectangle with a width-to-height ratio of 2:1, then do min(screen.width, screen.height*2) on the width instead. Same for the height, just multiply the screen.width argument.