layer_sequence_create

With this function you can create an instance of a sequence asset 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 as the X and Y position in the room to create the sequence at, and finally the ID of the sequence to create. The sequence ID is the name constant that you defined in the Asset Browser for the sequence. The function will return the unique ID of the sequence element, which can then be used in all further layer functions for sequences, or it can be used to retrieve the sequence instance struct using the function layer_sequence_get_instance().

 

Syntax:

layer_sequence_create(layer_id, x, y, sequence_id)

Argument Description
layer_id The unique ID value of the instance layer to target
x The x position in the room to create the sequence at
y The y position in the room to create the sequence at
sequence_id The sequence ID to create, as defined in the Asset Browser

 

Returns:

Integer (element ID)

 

Example:

var _s = layer_sequence_create("Background", 0, 0, seq_AnimatedBackground);
layer_sequence_pause(_s);

The above code creates a new sequence on the layer "Background" then pauses it.