- Title: Two Objects in View Example
- Description: This simple example will teach you how to put two objects in a view.
- GM Version: GM7
- Registered: No
- File Type: .ZIP
- File Size: 39.09 KB
- File Link: http://www.mediafire.com/?wa9twaolago
This example shows how two objects are put into one view. It was made in simple GML, but with comments to make sure you know what is going on. It requires no credit whatsoever. Also, you can use the graphics without giving credit, which were made in seconds.
Here is the simple script to use when you want two objects in a view:
/* TWO OBJECTS IN VIEW SCRIPT No credit is required to use this simple script! How to use: two_object_view(otherobject,viewnumber) By: daman123125*/ view_hview[argument1]=(distance_to_object(argument 0)*1.5)+150 //sets the height of the view to the distance to the second object times 1.5 plus 150 view_wview[argument1]=(distance_to_object(argument 0)*2)+180 //sets the width of the view to the distance to the second object times 2 plus 180 view_xview[argument1]=((x+argument0.x)/2)-(view_wview[argument1]/2)//sets the x position of the view view_yview[argument1]=((y+argument0.y)/2)-(view_hview[argument1]/2)// sets the y position of the view
Edited by daman123125, 16 April 2013 - 02:23 AM.