Pixel-Composer/scripts/node_array_length/node_array_length.gml

21 lines
541 B
Text
Raw Normal View History

2022-12-13 09:20:36 +01:00
function Node_Array_Length(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
name = "Array Length";
previewable = false;
w = 96;
h = 32 + 24;
min_h = h;
2022-01-19 03:05:13 +01:00
inputs[| 0] = nodeValue(0, "Array", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, 0)
.setVisible(true, true);
outputs[| 0] = nodeValue(0, "Size", self, JUNCTION_CONNECT.output, VALUE_TYPE.integer, 0);
2022-01-18 05:31:19 +01:00
static update = function() {
var _arr = inputs[| 0].getValue();
if(!is_array(_arr)) return;
outputs[| 0].setValue(array_length(_arr));
}
doUpdate();
}