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:
room_get_viewport(rm, vind);
Argument | Type | Description |
---|---|---|
rm | Room Asset | The room to get viewport data from |
vind | Real | The index of the view port to get |
Array (5 elements: visible, x, y, width, height)
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.