layer_get_all

This function will return an array populated with the unique ID values of each layer in the room.

 

Syntax:

layer_get_all()

 

Returns:

Array (populated with Layer IDs)

 

Example:

var a = layer_get_all();
for (var i = 0; i < array_length(a); i++;)
{
    layer_destroy(a[i]);
}

The above code retrieves all the layers in a room and adds their ID values to an array. This array is then parsed to destroy or the room layers.