With this function you can assign a camera to a specific viewport in a room other than the current one. You supply the room index, the view index (from 0 to 7) and then the index of the camera to use.
room_set_camera(rm, vind, camera);
|rm||The index of the room to set the view camera of|
|vind||The index of the view port to assign the camera to|
|camera||The index of the camera to assign|
global.myroom = room_add();
room_set_camera(global.myroom, 0, global.MainCam);
The above code assigns a camera in a newly created room to view port .