layer_get_shader


描述

This function can be used to check if the given layer has a shader assigned to it. 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 the function will return either the shader index of the shader assigned, or -1 if no shader is assigned.


语法:

layer_get_shader(layer_id)


参数:

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


返回:

Shader Index or -1if no shader is assigned


例如:

if layer_get_shader(layer) == -1
   {
   layer_shader(layer, shd_Sepia);
   }

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


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