2023-05-16 21:28:16 +02:00
|
|
|
function Node_Array_Copy(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
2024-03-28 14:18:02 +01:00
|
|
|
name = "Array Copy";
|
|
|
|
setDimension(96, 32 + 24);
|
2023-05-16 21:28:16 +02:00
|
|
|
|
2024-08-20 10:15:53 +02:00
|
|
|
newInput(0, nodeValue("Array", self, CONNECT_TYPE.input, VALUE_TYPE.any, 0))
|
2023-05-16 21:28:16 +02:00
|
|
|
.setArrayDepth(1)
|
|
|
|
.setVisible(true, true);
|
|
|
|
|
2024-08-18 06:16:20 +02:00
|
|
|
newInput(1, nodeValue_Int("Starting Index", self, 0));
|
2023-05-16 21:28:16 +02:00
|
|
|
|
2024-08-18 06:16:20 +02:00
|
|
|
newInput(2, nodeValue_Int("Size", self, 1));
|
2023-05-16 21:28:16 +02:00
|
|
|
|
2024-09-04 03:57:11 +02:00
|
|
|
newOutput(0, nodeValue_Output("Array", self, VALUE_TYPE.any, 0))
|
2023-05-16 21:28:16 +02:00
|
|
|
.setArrayDepth(1);
|
|
|
|
|
|
|
|
static step = function() {
|
|
|
|
var _typ = VALUE_TYPE.any;
|
2024-08-08 06:57:51 +02:00
|
|
|
if(inputs[0].value_from != noone) _typ = inputs[0].value_from.type;
|
2023-05-16 21:28:16 +02:00
|
|
|
|
2024-08-08 06:57:51 +02:00
|
|
|
inputs[0].setType(_typ);
|
|
|
|
outputs[0].setType(_typ);
|
2023-05-16 21:28:16 +02:00
|
|
|
}
|
|
|
|
|
2023-10-09 16:07:33 +02:00
|
|
|
static update = function(frame = CURRENT_FRAME) {
|
2023-10-02 08:57:44 +02:00
|
|
|
var _arr = getInputData(0);
|
|
|
|
var _ind = getInputData(1);
|
|
|
|
var _siz = getInputData(2);
|
2023-05-16 21:28:16 +02:00
|
|
|
|
|
|
|
if(!is_array(_arr)) return;
|
|
|
|
var res = [];
|
|
|
|
|
|
|
|
for( var i = 0; i < _siz; i++ )
|
2024-03-31 05:36:11 +02:00
|
|
|
res[i] = array_safe_get_fast(_arr, _ind + i);
|
2023-05-16 21:28:16 +02:00
|
|
|
|
2024-08-08 06:57:51 +02:00
|
|
|
outputs[0].setValue(res);
|
2023-05-16 21:28:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|