how to make the camera pan in a cutscene/cinematic

ETHC33

Member
in my cutscene I want to have the camera at the center and zoom out. then the background to switch and have the camera pan across horizontally as I have my text at the bottom of the screen. I wan't to do this to introduce my world and environment. If there is a good tutorial out there i'd love if you could attach it. I feel like I've been spamming questions recently but I really have lots of questions. I really appreciate all of your answers. Thanks!
 
you can use view_xview and view_yview to position the camera... so, let's say, to start with the camera at the center of the room, I would put this code inside the create event of an obj_camera instance:
GML:
//center the view
view_xview = (room_width / 2) - (view_wview / 2);
view_yview = (room_height / 2) - (view_hview / 2);
//how much it should zoom out:
max_w_size = view_wview + (view_wview / 2);
max_h_size = view_hview + (view_hview / 2);
Then, to zoom out, I would change the view size in step event, like this:
GML:
if view_wview < max_w_size
    view_wview += amount; //the amount would be how fast you want to zoom out
if view_hview < max_h_size
    view_hview += amount;
Then, to make it move horizontally, I would check if it has first zoomed out completely, then add 1 to view_xview:

GML:
if view_wview >= max_w_size
&& view_hview >= max_h_size
    view_xview += 1;
 

ETHC33

Member
Thanks for the long response, I’ll have to take a good long look at it tomorrow. It’s my first game and I’d really like to get this stuff figured out. Thanks for all your willingness to help I really appreciate it.
 
Top