layer_reset_target_room


描述

This function is used to reset the layer target to the current room. See the function layer_set_target_room for further information.


语法:

layer_reset_target_room()


返回:

N/A(无返回值)


例如:

layer_set_target_room(rm_Game);
var l = layer_get_id("SpriteAssets");
repeat(50)
   {
   layer_sprite_create(l, random(room_get_width(rm_Game)), random(room_get_height(rm_Game)), spr_Trees);
   }
layer_reset_target_room();

The above code sets the target room to the room "rm_Game" and then gets the layer ID for the layer called "SpriteAssets" in that room. This layer ID is then used to add 50 random sprite assets to the layer, before the layer target is reset to the current room.


上一页: General Layer Functions
next: layer_exists
© Copyright YoYo Games Ltd. 2018 All Rights Reserved