camera_set_default


Description

This function can be used to set the default camera to use a custom camera that you have previously created using one of the camera_create functions. When you create a room with no active view ports or view cameras, GameMaker Studio 2 still uses a camera to show the action in the game. This camera is called the default camera and can be set and manipulated (and even destroyed) just like any other camera.


Syntax:

camera_set_default(camera_id)


Arguments:

Argument Description
camera_id The unique camera ID value returned when you created the camera


Returns:

N/A


Example:

var new_cam = camera_create_view(0, 0, 640, 480, 0, obj_Player, 5, 5, -1, -1); camera_set_default(new_cam);

The above code creates a new camera and then assigns it as the default camera to use.


Back: Cameras
Next: camera_get_view_mat
© Copyright YoYo Games Ltd. 2018 All Rights Reserved