This function returns the script function index of the function assigned to run at the end of rendering the given layer, or it will return -1 if no function is assigned. You supply the layer ID (which you get when you create the layer using layer_create()) or the layer name (as a string - this will have a performance impact). You can assign script functions to a layer with layer_script_begin() and layer_script_end().
layer_get_script_end(layer_id);
Argument | Type | Description |
---|---|---|
layer_id | String or Layer | The unique ID value of the layer to target (or the layer name as a string) |
Script Function or -1 (if no function is assigned)
if (layer_get_script_end(layer) == -1)
{
layer_script_end(layer, scr_ResetShaderValues);
}
The above code will check to see if the layer that the instance running the code has a script function assigned to it and if it doesn't one is assigned.