I need help in making a camera that would follow between two objects moving apart from one another, include them in the display, and yet not show anything beyond the layout.
So far, with the use of the AdvancedCamera plugin (version 0.92b) and ShadeKirby500's help, the camera zooms out to include the two objects (in the case of the example I'm about to post, two objects with the 8-directional behavior; the actual game I'm working on will use two objects with the platforming behavior, but I digress); however, it zooms out to include things outside the perimeter of the layout, which is not what I want.
Here is an example I created to show how the camera behaves right now, and here is the AdvancedCamera plugin, version 0.92b (I don't feel like finding Linkman's original link).
The meat and potatoes right now are in the Always event under the Layout1's event sheet. The camera's zoom is set in both the x and y axis as,
clamp((DisplayWidth*(3/5))/abs(distance(PlayableCharacter1.X,PlayableCharacter1.Y,PlayableCharacter2.X,PlayableCharacter2.Y)),0,1) * 100[/code:r4oo0a5r]which sets the zoom to a ratio from the inclusion of 3/5 of the display's width in total between the two objects and their respective sides (which right now is a margin that is 3/5 the display's width for both objects) to the absolute distance between the two objects.
This formula for the zoom was created by ShadeKirby500, and I'm supposing with an educated guess that the second value in the clamp expression (b in "clamp(a,b,x)") would be the maximum zoom restriction.
Again, I'm supposing that that only fixes the total zoom, not the margins between the objects and the layout borders... which should decrease to zero once they reach the boundary of the layout.
Any help would be greatly, greatly appreciated... I've been at this with unsuccessful trials and errors for days now, along with the help of my real-life friend (with whom I'm making the aforementioned game with), ShadeKirby500, and Pixel Rebirth.
... Please?