Hello, how do I make it so that it uses existing layers instead of creating a new one?
function __roomloader_create_layer(_data) {
var _existing_layer = layer_get_id(_data.name);
var _layer = _existing_layer > -1 ? _existing_layer : layer_create(_data.depth, _data.name);
layer_set_visible(_layer, _data.visible);
layer_x(_layer, _data.xoffset);
layer_y(_layer, _data.yoffset);
layer_hspeed(_layer, _data.hspeed);
layer_vspeed(_layer, _data.vspeed);
return _layer;
}
I modified this function like this but doesn't seem to work, thanks