layer_reset_target_room


Description

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


Syntax:

layer_reset_target_room()


Returns:

N/A


Example:

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.


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