With this function you can set the view port properties for any room in your game except the current one. You supply the room index to set the view port in, the view port index (from 0 to 7) and then whether the view port should be visible at the start of the room or not (set to true to make the port visible, and false otherwise). After that you set the x and y coordinate (corresponding to the top left position of the view port) and then the width and height in pixels.


room_set_viewport(rm, vind, vis, xport, yport, wport, hport);


Argument Description
rm The index of the room to set
vind The index of the view port to set
vis The visibility of the view port (true is visible, false is invisible)
xport The x position for the view port in the room
yport The y position of the view port in the room
wport The width (in pixels) of the view port
hport The height (in pixels) of the view port




global.myroom = room_add();
room_set_width(global.myroom, 640);
room_set_height(global.myroom, 480);
room_set_viewport(global.myroom, 0, true, 0, 0, 640, 480);

This will set the view port [0] properties in the room indexed in the variable "global.myroom".

Back: General Room Functions And Variables
Next: room_get_viewport
© Copyright YoYo Games Ltd. 2018 All Rights Reserved