room_exists


描述

With this function you can check and see whether the room you specify exists or not. This function takes the room index (a real number) and not the room name (a string). This function is most useful when you are creating rooms dynamically using the function room_add, but you can also use the read only variables room_first and room_last or the functions room_next and room_previous to get a specific room index, or provide a variable that has stored the index of any other room in your game.


语法:

room_exists(index);


参数:

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


返回:

Boolean(布尔值)


例如:

if room_exists(global.rm[0])
   {
   room_goto(global.rm[0]);
   }

The above code checks to see if the room indexed in the array "global.rm[]" exists and if it does it then goes to that room.


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