room_goto


描述

This function permits you to go to any room in your game project, whether created using code or in the resource tree. You supply the unique room ID value (stored in the variable for the room name, or as a variable returned from the function room_add. Note that calling this function does not instantly change rooms, and the room will not change until the end of the current game frame (meaning that any code after this function will still be run, as will some events). This function will also trigger the Room End event.


语法:

room_goto(index);


参数:

参数 描述
index The index of the room to go to.


返回:

N/A(无返回值)


例如:

switch (global.rm)
   {
   case 0: room_goto(rm_level1); break;
   case 1: room_goto(rm_level2); break;
   case 2: room_goto(rm_level3); break;
   }

The above code will check a global variable and change room based on the value that it holds.


上一页: General Room Functions And Variables
下一页: room_goto_next
© Copyright YoYo Games Ltd. 2018 All Rights Reserved