Pixel-Composer/scripts/node_FLIP_wall/node_FLIP_wall.gml

43 lines
1.4 KiB
Text
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();
index = 0;
2024-03-14 14:35:19 +01:00
static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) { #region
if(inputs[| 1].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny)) active = false;
2023-12-31 14:09:49 +01:00
} #endregion
static update = function(frame = CURRENT_FRAME) { #region
var domain = getInputData(0);
if(!instance_exists(domain)) return;
outputs[| 0].setValue(domain);
var _area = getInputData(1);
FLIP_setSolid_rectangle(domain.domain, index, _area[0], _area[1], _area[2], _area[3]);
} #endregion
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
var bbox = drawGetBbox(xx, yy, _s);
draw_sprite_fit(s_node_fluidSim_wall, 0, bbox.xc, bbox.yc, bbox.w, bbox.h);
}
}