layer_sequence_exists

With this function you can check to see if a sequence element exists on the given layer. You supply the layer ID which can be a string of the layer name - as defined in the Room Editor - or the unique layer ID - as returned by the function layer_get_id(), as well the sequence element ID - as returned by layer_sequence_create() or by one of the layer element functions - and it will return true if the given element exists or false otherwise.

 

Syntax:

layer_sequence_exists(layer_id, sequence_element_id)

ArgumentTypeDescription
layer_IDString or LayerThe unique ID or name of the layer to check
sequence_element_idSequence Element IDThe unique ID value of the sequence element to target

 

Returns:

Boolean

 

Example:

if (!layer_sequence_exists("Background", my_seq))
{
    my_seq = layer_sequence_create("Background", 0, 0, seq_AnimatedBackground);
    layer_sequence_pause(my_seq);
}

The above code checks to see if the given sequence element exists, and if it does not then it creates a new sequence on the given layer then pauses it.