Hello Im super new but would be so thankful for a tip on how to accomplish Naelian's code.
I tried "Naelian's" way and ended up having this: (sorry I can't upload my dropboxed screenshot)
On every ticks ->
set layout scale to clamp(1 - distance(p1.x, p1.y, p2.x, p2.y) / (layoutHeight + layoutWidth), 0.5, 1)
scroll to ( (p1.X+p2.X)/2, ((p1.Y+p2.Y)/2 ) JUST FOUND OUT THAT MY SCROLL TO ACTION DOESNT WORK AT ALL
I set the Naelian's "0.1 and 1) to "0.5 and 1" but Im not quiet sure what they really do. Now I ended up with having the superb opposite of what i want. If the two player are close my window/levelbackground is like fullscreen and when the two player go as far as they can its about 50% zoomed out.
But I want it to be "full" when the player are far away and just a little zoomed in when they get closer. Inverting the "0.5,1" to a "1,0.5" didn't solve it. All just stayed "full" without zooming. This must be funny for you