Pixel-Composer/scripts/node_FLIP_wall/node_FLIP_wall.gml

40 lines
1.3 KiB
Plaintext
Raw Normal View History

2023-12-31 14:09:49 +01:00
function Node_FLIP_Wall(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
name = "Wall";
color = COLORS.node_blend_fluid;
icon = THEME.fluid_sim;
2024-03-28 14:18:02 +01:00
setDimension(96, 96);
2023-12-31 14:09:49 +01:00
manual_ungroupable = false;
inputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.input, VALUE_TYPE.fdomain, noone )
.setVisible(true, true);
inputs[| 1] = nodeValue("Area", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, DEF_AREA )
2024-03-31 05:36:11 +02:00
.setDisplay(VALUE_DISPLAY.area, { useShape : false });
2023-12-31 14:09:49 +01:00
input_display_list = [ 0,
["Collider", false], 1
]
outputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.output, VALUE_TYPE.fdomain, noone );
obstracle = new FLIP_Obstracle();
static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) {
2024-03-14 14:35:19 +01:00
if(inputs[| 1].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny)) active = false;
}
2023-12-31 14:09:49 +01:00
static update = function(frame = CURRENT_FRAME) {
2023-12-31 14:09:49 +01:00
var domain = getInputData(0);
var _area = getInputData(1);
2023-12-31 14:09:49 +01:00
if(!instance_exists(domain)) return;
outputs[| 0].setValue(domain);
FLIP_setSolid_rectangle(domain.domain, _area[0], _area[1], _area[2], _area[3]);
}
2023-12-31 14:09:49 +01:00
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
var bbox = drawGetBbox(xx, yy, _s);
draw_sprite_bbox_uniform(s_node_fluidSim_wall, 0, bbox);
2023-12-31 14:09:49 +01:00
}
}