layer_get_script_begin


描述

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) and this function will return the script index of the script assigned to run at the beginning of rendering for that layer, or it will return -1 if no script is assigned.


语法:

layer_get_script_begin(layer_id);


参数:

参数 描述
layer_id The unique ID value of the layer to target (or the layer name as a string)


返回:

Script Index (Real) or -1 if no script is assigned


例如:

if layer_get_script_begin(layer) == -1
   {
   layer_script_begin(layer, scr_SetShaderValues);
   }

The above code will check to see if the layer that the instance running the code has a script assigned to it and if it doesn't one is assigned.


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