layer_get_element_layer


Description

You can use this function to get the Layer ID that the given element is on. You supply the unique element ID value (for example, as returned the function that created the element or from the room editor) and the function will return the unique ID of the layer that the element is found on. If the element ID given is not a valid one, then the function will return -1.


Syntax:

layer_get_element_layer(element_id)


Arguments:

Argument Description
element_id The unique ID value of the element to get the layer of


Returns:

Layer ID or -1 if the element is invalid (ie: does not exist)


Example:

element = layer_get_element_layer(asset_1);

The above code gets layer ID for the element with the ID stored in the variable "asset_1" and stores it in a variable.


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