Script: Keeping Two Objects In The Same View

This script will stretch the view in the room so two objects are always shown (Super Smash Brothers-style). To make this work, go into your rooms' properties, tick Enable the use of Views and Visible when room starts but change nothing else, then paste the code below into the Step event of one of the two objects, changing object1 to the name of your other object.

view_hview[0]=(distance_to_object(object1)*1.5)+150
view_wview[0]=(distance_to_object(object1)*2)+200
view_xview[0]=((x+object1.x)/2)-(view_wview[0]/2)
view_yview[0]=((y+object1.y)/2)-(view_hview[0]/2)
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License