room_get_viewport

This function retrieves the details of a view port in a room other than the current one.

You give the room and the index of the view port to retrieve (from 0 to 7) and the function will return an array of 5 indices, where:

 

Syntax:

room_get_viewport(rm, vind);

ArgumentTypeDescription
rmRoom AssetThe room to get viewport data from
vindRealThe index of the view port to get

 

Returns:

Array (5 elements: visible, x, y, width, height)

 

Example:

var _view_values = room_get_viewport(rm_Game, 0);
var _visible_text = _view_values[0] ? "visible" : "invisible";
show_debug_message($"Viewport 0 in rm_Game is {_visible_text} and drawn at the position: {_view_values[1]}, {_view_values[2]}. Its dimensions are {_view_values[3]}x{_view_values[4]}.");

The above code retrieves the view port data for the given room then checks to see if the port is flagged as visible. If it is not, the view port data is set to make it visible.