Pixel-Composer/scripts/node_timeline_preview/node_timeline_preview.gml

23 lines
606 B
Plaintext
Raw Normal View History

2023-02-28 09:43:01 +01:00
function Node_Timeline_Preview(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
2022-01-13 05:24:03 +01:00
name = "Timeline";
2023-10-02 14:41:44 +02:00
use_cache = CACHE_USE.auto;
2022-11-18 03:20:31 +01:00
color = COLORS.node_blend_number;
2022-01-13 05:24:03 +01:00
2024-05-02 11:05:02 +02:00
setDimension(96, 48);
2023-01-17 08:11:55 +01:00
2022-01-13 05:24:03 +01:00
PANEL_ANIMATION.timeline_preview = self;
2024-08-08 06:57:51 +02:00
inputs[0] = nodeValue_Surface("Surface", self);
2022-01-13 05:24:03 +01:00
2023-10-09 16:07:33 +02:00
static update = function(frame = CURRENT_FRAME) {
var _inSurf = getInputData(0);
2022-01-13 05:24:03 +01:00
if(_inSurf == 0) return;
if(is_array(_inSurf)) {
if(surface_exists(_inSurf[preview_index]))
cacheCurrentFrame(_inSurf[preview_index]);
} else if(surface_exists(_inSurf))
cacheCurrentFrame(_inSurf);
}
}