Hey ThunderLion,
One way you might do this is by changing the zoom level based on the player's distance from the center of the layout.
You can get the distance between points with C2's built-in distance() function.
e.g. Below is the distance from the center of the layout to the player:
distance( layoutWidth / 2 , layoutHeight / 2 , Player.X , Player.Y )
let's call this "playerDistance".
Below is the distance from the center of the layout to a corner of the layout, (the max possible distance from the center):
distance( 0 , 0 , layoutWidth / 2 , layoutHeight / 2 )
let's call this "maxDistance".
If the layout is 1000 x 1000 pixels, then the farthest you can get from the middle is 500 px at the middle of a layout edge, and about 700 px in the layout corner.
(The 700 in this case comes from distance( 0 , 0 , 1000 , 1000 ) ~= 707 ~= 700.)
So the maxDistance would be about 700.
Thus, your playerDistance value is going to range from 0 (when the player is in the middle) to 700 (when the player is in the corner), roughly.
So, if you divide your playerDistance by maxDistance, you get a result that ranges from 0 to 1. (i.e. 0/700 to 700/700)
Lets call this "normalizedDistance".
You can set your zoom level to 100 + ( 100 * normalizedDistance )
With the player in the center of the layout, that expression becomes:
zoom = 100 + ( 100 * 0 ) ... = 100 + ( 0 ) ... = 100
With the player in the corner of the layout, that expression becomes:
zoom = 100 + ( 100 * 1 ) ... = 100 + ( 100 ) ... = 200
This means your zoom level will smoothly go from 100% to 200%, as the player goes from the center to the corner of the level.
So the final formula would be:
zoom = 100 + ( 100 * ( distance( layoutWidth / 2 , layoutHeight / 2 , Player.X , Player.Y ) / distance( 0 , 0 , layoutWidth / 2 , layoutHeight / 2 ) ) )
Thinking of it in terms of the intermediate variables I described above, the expression evaluates as follows:
zoom = 100 + ( 100 * ( distance( layoutWidth / 2 , layoutHeight / 2 , Player.X , Player.Y ) / distance( 0 , 0 , layoutWidth / 2 , layoutHeight / 2 ) ) )
zoom = 100 + ( 100 * ( playerDistance / maxDistance ) )
zoom = 100 + ( 100 * ( normalizedDistance ) )
zoom = Some number ranging from 100 to 200 depending on the player's distance from the center of the layout.