Now that the basic view parameter variables have been covered, the camera object can be made. Only one new object resource needs to be created; this object resource will be named obj_camera
. It will have a Create event and an End Step event. The Create event will mostly define variables, while the End Step event will be used to actually move the camera.
As with many of the object resources previously created in this book, the Create event of obj_camera
will define a variety of variables. The following script will be executed by the Create event:
/// Initializes variables for the camera. // The index of the view that will be manipulated. view_index = 0; // The left most limit that the camera can move. limit_left = 0; // The right most limit that the camera can move. limit_right = room_width; // The top most limit that the camera can move. limit_top = 0; // The bottom most limit that the camera can move. limit_bottom = room_height; // The...