layer_get_element_layer


描述

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.


语法:

layer_get_element_layer(element_id)


参数:

参数 描述
element_id The unique ID value of the element to get the layer of


返回:

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


例如:

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.


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