room_add


描述

This function will create a new, empty, room and add it to your game, returning its index to be stored in a variable for all further codes that deal with this room. Note that each room is permanently added to the game until the executable is closed, ie: rooms added through code cannot be deleted again. This has important implications for memory use and so you should use this function with care.

NOTE: New rooms are not part of usual room ordering, so they do not have a "previous" or "next" room (meaning that the functions room_next and room_previous will not work). To jump from the added room to another, you must use the index of the room itself.
重要!该函数在试用版(Trial License)产品中可用。


语法:

room_add();


返回:

索引


例如:

global.myroom = room_add();
room_set_width(global.myroom, 640);
room_set_height(global.myroom, 480);
room_set_persistent(global.myroom, false);

This will create a new room and store its index in the variable "global.myroom". It will then set its width to 640 pixels, its height to 480 pixels, and its persistence to false.


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