room_get_camera

This function gets the unique index ID of the camera assigned to a specific view in a room other than the current one.

You give the room to use, the view port to use (from 0 to 7) and the function will return a camera index.

 

Syntax:

room_get_camera(rm, vind);

ArgumentTypeDescription
rmRoom AssetThe room to get the view camera of
vindRealThe index of the view port to get the camera of

 

Returns:

Camera ID

 

Example:

var cam = room_get_camera(rm_Game, 0);
if (cam != global.MainCam)
{
    room_set_camera(rm_Game, 0, global.MainCam);
}

The above code assigns a camera in a newly created room to view port [0].