I need some help in 'camera maths'. I have a birds eye view of two characters. One character is static and the other can move. I would like the camera to always show both characters in full and, in order to simulate 'zooming out', I'm uniform-scaling the objects. The static character is always at the top of the screen and so the 'camera' can't move along the Y-axis (otherwise the static character would not be shown in whole). However, it can move along the X-axis as far as possible, until the screen reaches the side of the static character. How can I calculate the minimum distance the camera should zoom out in order to ensure that both objects are always on screen?
I hope that makes sense, but I'd be happy to try and clarify it if need be. Thanks.