mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2025-01-23 03:18:03 +01:00
1.13pr11
This commit is contained in:
parent
e6fbdc039f
commit
d9e3d4bb87
72 changed files with 1401 additions and 185 deletions
|
@ -51,7 +51,7 @@
|
|||
{"id":{"name":"sh_perlin_smear","path":"shaders/sh_perlin_smear/sh_perlin_smear.yy",},"order":7,},
|
||||
{"id":{"name":"node_array_remove","path":"scripts/node_array_remove/node_array_remove.yy",},"order":0,},
|
||||
{"id":{"name":"node_path_blend","path":"scripts/node_path_blend/node_path_blend.yy",},"order":0,},
|
||||
{"id":{"name":"node_switch","path":"scripts/node_switch/node_switch.yy",},"order":8,},
|
||||
{"id":{"name":"node_switch","path":"scripts/node_switch/node_switch.yy",},"order":5,},
|
||||
{"id":{"name":"sh_corner","path":"shaders/sh_corner/sh_corner.yy",},"order":20,},
|
||||
{"id":{"name":"node_array","path":"scripts/node_array/node_array.yy",},"order":8,},
|
||||
{"id":{"name":"sh_colorize","path":"shaders/sh_colorize/sh_colorize.yy",},"order":9,},
|
||||
|
@ -111,6 +111,7 @@
|
|||
{"id":{"name":"math_function","path":"scripts/math_function/math_function.yy",},"order":7,},
|
||||
{"id":{"name":"scrollBox","path":"scripts/scrollBox/scrollBox.yy",},"order":13,},
|
||||
{"id":{"name":"o_dialog_exit","path":"objects/o_dialog_exit/o_dialog_exit.yy",},"order":2,},
|
||||
{"id":{"name":"node_polygonal_shape","path":"scripts/node_polygonal_shape/node_polygonal_shape.yy",},"order":27,},
|
||||
{"id":{"name":"fd_rectangle_get_collision_mask_sprite","path":"scripts/fd_rectangle_get_collision_mask_sprite/fd_rectangle_get_collision_mask_sprite.yy",},"order":4,},
|
||||
{"id":{"name":"node_flip","path":"scripts/node_flip/node_flip.yy",},"order":13,},
|
||||
{"id":{"name":"shader_set_functions","path":"scripts/shader_set_functions/shader_set_functions.yy",},"order":0,},
|
||||
|
@ -167,6 +168,7 @@
|
|||
{"id":{"name":"s_node_boolean","path":"sprites/s_node_boolean/s_node_boolean.yy",},"order":0,},
|
||||
{"id":{"name":"s_workshop_badge","path":"sprites/s_workshop_badge/s_workshop_badge.yy",},"order":1,},
|
||||
{"id":{"name":"node_compare","path":"scripts/node_compare/node_compare.yy",},"order":16,},
|
||||
{"id":{"name":"node_iterator_each_size","path":"scripts/node_iterator_each_size/node_iterator_each_size.yy",},"order":3,},
|
||||
{"id":{"name":"fd_draw_self_to_collision_mask_surface","path":"scripts/fd_draw_self_to_collision_mask_surface/fd_draw_self_to_collision_mask_surface.yy",},"order":0,},
|
||||
{"id":{"name":"s_node_HSV_combine","path":"sprites/s_node_HSV_combine/s_node_HSV_combine.yy",},"order":42,},
|
||||
{"id":{"name":"node_normal_light","path":"scripts/node_normal_light/node_normal_light.yy",},"order":0,},
|
||||
|
@ -217,6 +219,7 @@
|
|||
{"id":{"name":"node_color_from_rgb","path":"scripts/node_color_from_rgb/node_color_from_rgb.yy",},"order":7,},
|
||||
{"id":{"name":"node_transform","path":"scripts/node_transform/node_transform.yy",},"order":0,},
|
||||
{"id":{"name":"curveBox","path":"scripts/curveBox/curveBox.yy",},"order":8,},
|
||||
{"id":{"name":"s_node_iterator_length","path":"sprites/s_node_iterator_length/s_node_iterator_length.yy",},"order":24,},
|
||||
{"id":{"name":"preview_overlay_vector","path":"scripts/preview_overlay_vector/preview_overlay_vector.yy",},"order":2,},
|
||||
{"id":{"name":"sh_gradient_display","path":"shaders/sh_gradient_display/sh_gradient_display.yy",},"order":18,},
|
||||
{"id":{"name":"node_json_file_write","path":"scripts/node_json_file_write/node_json_file_write.yy",},"order":12,},
|
||||
|
@ -366,6 +369,7 @@
|
|||
{"id":{"name":"o_dialog_drag_folder","path":"objects/o_dialog_drag_folder/o_dialog_drag_folder.yy",},"order":2,},
|
||||
{"id":{"name":"node_VFX_effect_repel","path":"scripts/node_VFX_effect_repel/node_VFX_effect_repel.yy",},"order":9,},
|
||||
{"id":{"name":"s_node_alpha_cut","path":"sprites/s_node_alpha_cut/s_node_alpha_cut.yy",},"order":1,},
|
||||
{"id":{"name":"node_iterator_length","path":"scripts/node_iterator_length/node_iterator_length.yy",},"order":3,},
|
||||
{"id":{"name":"node_VFX_effect_attract","path":"scripts/node_VFX_effect_attract/node_VFX_effect_attract.yy",},"order":8,},
|
||||
{"id":{"name":"node_fluid_repulse","path":"scripts/node_fluid_repulse/node_fluid_repulse.yy",},"order":0,},
|
||||
{"id":{"name":"s_node_text_splice","path":"sprites/s_node_text_splice/s_node_text_splice.yy",},"order":6,},
|
||||
|
@ -425,6 +429,7 @@
|
|||
{"id":{"name":"o_dialog_add_multiple_images","path":"objects/o_dialog_add_multiple_images/o_dialog_add_multiple_images.yy",},"order":0,},
|
||||
{"id":{"name":"assets_data","path":"scripts/assets_data/assets_data.yy",},"order":0,},
|
||||
{"id":{"name":"s_node_loop_array","path":"sprites/s_node_loop_array/s_node_loop_array.yy",},"order":23,},
|
||||
{"id":{"name":"s_node_iterator_amount","path":"sprites/s_node_iterator_amount/s_node_iterator_amount.yy",},"order":26,},
|
||||
{"id":{"name":"sh_color_adjust","path":"shaders/sh_color_adjust/sh_color_adjust.yy",},"order":6,},
|
||||
{"id":{"name":"sh_fd_visualize_thick_smoke_glsl","path":"shaders/sh_fd_visualize_thick_smoke_glsl/sh_fd_visualize_thick_smoke_glsl.yy",},"order":17,},
|
||||
{"id":{"name":"surface_get_palette","path":"scripts/surface_get_palette/surface_get_palette.yy",},"order":2,},
|
||||
|
@ -541,6 +546,7 @@
|
|||
{"id":{"name":"node_seperate_shapes","path":"scripts/node_seperate_shapes/node_seperate_shapes.yy",},"order":9,},
|
||||
{"id":{"name":"node_fluid_domain_queue","path":"scripts/node_fluid_domain_queue/node_fluid_domain_queue.yy",},"order":9,},
|
||||
{"id":{"name":"node_sequence_to_anim","path":"scripts/node_sequence_to_anim/node_sequence_to_anim.yy",},"order":3,},
|
||||
{"id":{"name":"sh_blend_replace","path":"shaders/sh_blend_replace/sh_blend_replace.yy",},"order":50,},
|
||||
{"id":{"name":"node_rigid_render","path":"scripts/node_rigid_render/node_rigid_render.yy",},"order":3,},
|
||||
{"id":{"name":"node_image_sheet","path":"scripts/node_image_sheet/node_image_sheet.yy",},"order":4,},
|
||||
{"id":{"name":"sh_posterize_palette","path":"shaders/sh_posterize_palette/sh_posterize_palette.yy",},"order":12,},
|
||||
|
@ -599,6 +605,7 @@
|
|||
{"id":{"name":"node_fluid_sim","path":"scripts/node_fluid_sim/node_fluid_sim.yy",},"order":0,},
|
||||
{"id":{"name":"sh_convolution","path":"shaders/sh_convolution/sh_convolution.yy",},"order":44,},
|
||||
{"id":{"name":"s_node_statistic","path":"sprites/s_node_statistic/s_node_statistic.yy",},"order":5,},
|
||||
{"id":{"name":"s_node_cache_array","path":"sprites/s_node_cache_array/s_node_cache_array.yy",},"order":25,},
|
||||
{"id":{"name":"sh_blend_alpha_addition","path":"shaders/sh_blend_alpha_addition/sh_blend_alpha_addition.yy",},"order":13,},
|
||||
{"id":{"name":"widget","path":"scripts/widget/widget.yy",},"order":25,},
|
||||
{"id":{"name":"node_VFX_effect_vortex","path":"scripts/node_VFX_effect_vortex/node_VFX_effect_vortex.yy",},"order":10,},
|
||||
|
@ -687,6 +694,7 @@
|
|||
{"id":{"name":"_f_p3","path":"fonts/_f_p3/_f_p3.yy",},"order":7,},
|
||||
{"id":{"name":"node_group_input","path":"scripts/node_group_input/node_group_input.yy",},"order":1,},
|
||||
{"id":{"name":"fd_rectangle_set_material_dissipation_type","path":"scripts/fd_rectangle_set_material_dissipation_type/fd_rectangle_set_material_dissipation_type.yy",},"order":4,},
|
||||
{"id":{"name":"node_cache_array","path":"scripts/node_cache_array/node_cache_array.yy",},"order":8,},
|
||||
{"id":{"name":"draw_rect_border","path":"scripts/draw_rect_border/draw_rect_border.yy",},"order":6,},
|
||||
{"id":{"name":"node_composite","path":"scripts/node_composite/node_composite.yy",},"order":1,},
|
||||
{"id":{"name":"s_node_path_map","path":"sprites/s_node_path_map/s_node_path_map.yy",},"order":2,},
|
||||
|
@ -701,7 +709,7 @@
|
|||
{"id":{"name":"libxprocess","path":"extensions/libxprocess/libxprocess.yy",},"order":0,},
|
||||
{"id":{"name":"sh_mirror","path":"shaders/sh_mirror/sh_mirror.yy",},"order":0,},
|
||||
{"id":{"name":"sh_cell_noise_random","path":"shaders/sh_cell_noise_random/sh_cell_noise_random.yy",},"order":6,},
|
||||
{"id":{"name":"node_iterator_input","path":"scripts/node_iterator_input/node_iterator_input.yy",},"order":2,},
|
||||
{"id":{"name":"node_iterator_input","path":"scripts/node_iterator_input/node_iterator_input.yy",},"order":1,},
|
||||
{"id":{"name":"s_node_atlas","path":"sprites/s_node_atlas/s_node_atlas.yy",},"order":3,},
|
||||
{"id":{"name":"node_fluid_add","path":"scripts/node_fluid_add/node_fluid_add.yy",},"order":4,},
|
||||
{"id":{"name":"o_dialog_output_visibility","path":"objects/o_dialog_output_visibility/o_dialog_output_visibility.yy",},"order":2,},
|
||||
|
@ -712,6 +720,7 @@
|
|||
{"id":{"name":"fd_rectangle_set_collision_mask_surface","path":"scripts/fd_rectangle_set_collision_mask_surface/fd_rectangle_set_collision_mask_surface.yy",},"order":2,},
|
||||
{"id":{"name":"node_array_length","path":"scripts/node_array_length/node_array_length.yy",},"order":11,},
|
||||
{"id":{"name":"node_erode","path":"scripts/node_erode/node_erode.yy",},"order":9,},
|
||||
{"id":{"name":"draw_circle_angle","path":"scripts/draw_circle_angle/draw_circle_angle.yy",},"order":15,},
|
||||
{"id":{"name":"node_wrap_mesh","path":"scripts/node_wrap_mesh/node_wrap_mesh.yy",},"order":6,},
|
||||
{"id":{"name":"node_curve","path":"scripts/node_curve/node_curve.yy",},"order":0,},
|
||||
{"id":{"name":"sh_alpha_hash","path":"shaders/sh_alpha_hash/sh_alpha_hash.yy",},"order":43,},
|
||||
|
@ -755,7 +764,7 @@
|
|||
{"id":{"name":"sh_shadow_cast_light_sep","path":"shaders/sh_shadow_cast_light_sep/sh_shadow_cast_light_sep.yy",},"order":1,},
|
||||
{"id":{"name":"node_grid","path":"scripts/node_grid/node_grid.yy",},"order":16,},
|
||||
{"id":{"name":"node_edge_detect","path":"scripts/node_edge_detect/node_edge_detect.yy",},"order":8,},
|
||||
{"id":{"name":"node_tunnel_in","path":"scripts/node_tunnel_in/node_tunnel_in.yy",},"order":9,},
|
||||
{"id":{"name":"node_tunnel_in","path":"scripts/node_tunnel_in/node_tunnel_in.yy",},"order":6,},
|
||||
{"id":{"name":"node_anim_priority","path":"scripts/node_anim_priority/node_anim_priority.yy",},"order":2,},
|
||||
{"id":{"name":"s_node_fluidSim_render","path":"sprites/s_node_fluidSim_render/s_node_fluidSim_render.yy",},"order":4,},
|
||||
{"id":{"name":"o_dialog_crashed","path":"objects/o_dialog_crashed/o_dialog_crashed.yy",},"order":1,},
|
||||
|
@ -904,7 +913,7 @@
|
|||
{"id":{"name":"libdlgmodule","path":"extensions/libdlgmodule/libdlgmodule.yy",},"order":7,},
|
||||
{"id":{"name":"draw_background_stretched","path":"scripts/draw_background_stretched/draw_background_stretched.yy",},"order":5,},
|
||||
{"id":{"name":"s_node_path","path":"sprites/s_node_path/s_node_path.yy",},"order":0,},
|
||||
{"id":{"name":"node_tunnel_out","path":"scripts/node_tunnel_out/node_tunnel_out.yy",},"order":10,},
|
||||
{"id":{"name":"node_tunnel_out","path":"scripts/node_tunnel_out/node_tunnel_out.yy",},"order":7,},
|
||||
{"id":{"name":"s_node_array_shuffle","path":"sprites/s_node_array_shuffle/s_node_array_shuffle.yy",},"order":10,},
|
||||
{"id":{"name":"node_level","path":"scripts/node_level/node_level.yy",},"order":7,},
|
||||
{"id":{"name":"o_dialog_warning","path":"objects/o_dialog_warning/o_dialog_warning.yy",},"order":10,},
|
||||
|
@ -963,6 +972,7 @@
|
|||
{"id":{"name":"s_node_zoom","path":"sprites/s_node_zoom/s_node_zoom.yy",},"order":52,},
|
||||
{"id":{"name":"migration_function","path":"scripts/migration_function/migration_function.yy",},"order":0,},
|
||||
{"id":{"name":"sh_channel_V","path":"shaders/sh_channel_V/sh_channel_V.yy",},"order":6,},
|
||||
{"id":{"name":"__shapes","path":"scripts/__shapes/__shapes.yy",},"order":16,},
|
||||
{"id":{"name":"node_alpha_to_grey","path":"scripts/node_alpha_to_grey/node_alpha_to_grey.yy",},"order":3,},
|
||||
{"id":{"name":"shell_helper","path":"scripts/shell_helper/shell_helper.yy",},"order":20,},
|
||||
{"id":{"name":"o_dialog_preference","path":"objects/o_dialog_preference/o_dialog_preference.yy",},"order":7,},
|
||||
|
@ -975,7 +985,7 @@
|
|||
{"id":{"name":"node_solid","path":"scripts/node_solid/node_solid.yy",},"order":14,},
|
||||
{"id":{"name":"sh_blend_luma","path":"shaders/sh_blend_luma/sh_blend_luma.yy",},"order":19,},
|
||||
{"id":{"name":"fd_rectangle_set_material_dissipation_value","path":"scripts/fd_rectangle_set_material_dissipation_value/fd_rectangle_set_material_dissipation_value.yy",},"order":5,},
|
||||
{"id":{"name":"node_iterator_output","path":"scripts/node_iterator_output/node_iterator_output.yy",},"order":3,},
|
||||
{"id":{"name":"node_iterator_output","path":"scripts/node_iterator_output/node_iterator_output.yy",},"order":2,},
|
||||
{"id":{"name":"debug","path":"scripts/debug/debug.yy",},"order":9,},
|
||||
{"id":{"name":"node_shadow_cast","path":"scripts/node_shadow_cast/node_shadow_cast.yy",},"order":15,},
|
||||
{"id":{"name":"s_node_3d_obj_combine","path":"sprites/s_node_3d_obj_combine/s_node_3d_obj_combine.yy",},"order":5,},
|
||||
|
@ -1081,13 +1091,13 @@
|
|||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"compose","folderPath":"folders/nodes/data/compose.yy","order":15,},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"feedback","folderPath":"folders/nodes/data/feedback.yy","order":14,},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"filter","folderPath":"folders/nodes/data/filter.yy","order":1,},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"blur","folderPath":"folders/nodes/data/filter/blur.yy","order":57,},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"colors","folderPath":"folders/nodes/data/filter/colors.yy","order":61,},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"combine","folderPath":"folders/nodes/data/filter/combine.yy","order":58,},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"conversion","folderPath":"folders/nodes/data/filter/conversion.yy","order":62,},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"effects","folderPath":"folders/nodes/data/filter/effects.yy","order":60,},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"fixes","folderPath":"folders/nodes/data/filter/fixes.yy","order":63,},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"warps","folderPath":"folders/nodes/data/filter/warps.yy","order":59,},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"blur","folderPath":"folders/nodes/data/filter/blur.yy","order":0,},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"colors","folderPath":"folders/nodes/data/filter/colors.yy","order":4,},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"combine","folderPath":"folders/nodes/data/filter/combine.yy","order":1,},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"conversion","folderPath":"folders/nodes/data/filter/conversion.yy","order":5,},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"effects","folderPath":"folders/nodes/data/filter/effects.yy","order":3,},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"fixes","folderPath":"folders/nodes/data/filter/fixes.yy","order":6,},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"warps","folderPath":"folders/nodes/data/filter/warps.yy","order":2,},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"fluidSim","folderPath":"folders/nodes/data/fluidSim.yy","order":19,},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"generator","folderPath":"folders/nodes/data/generator.yy","order":4,},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"group","folderPath":"folders/nodes/data/group.yy","order":6,},
|
||||
|
|
|
@ -10,6 +10,7 @@ event_inherited();
|
|||
|
||||
scrollbox = noone;
|
||||
initVal = 0;
|
||||
update_hover = true;
|
||||
|
||||
anchor = ANCHOR.top | ANCHOR.left;
|
||||
|
||||
|
@ -56,10 +57,12 @@ event_inherited();
|
|||
_h += hght;
|
||||
}
|
||||
|
||||
UNDO_HOLDING = true;
|
||||
if(hovering > -1) scrollbox.onModify(hovering);
|
||||
else scrollbox.onModify(initVal);
|
||||
UNDO_HOLDING = false;
|
||||
if(update_hover) {
|
||||
UNDO_HOLDING = true;
|
||||
if(hovering > -1) scrollbox.onModify(hovering);
|
||||
else scrollbox.onModify(initVal);
|
||||
UNDO_HOLDING = false;
|
||||
}
|
||||
|
||||
if(sFOCUS) {
|
||||
if(keyboard_check_pressed(vk_up)) {
|
||||
|
|
|
@ -41,7 +41,10 @@
|
|||
string_lead_zero(current_minute, 2) +
|
||||
string_lead_zero(current_second, 2) + ".pxc";
|
||||
|
||||
SAVE_AT(loc + fname, "Autosaved ");
|
||||
try
|
||||
SAVE_AT(loc + fname, "Autosaved ");
|
||||
catch(e)
|
||||
print(exception_print(e));
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
|
253
scripts/__shapes/__shapes.gml
Normal file
253
scripts/__shapes/__shapes.gml
Normal file
|
@ -0,0 +1,253 @@
|
|||
#region shapes
|
||||
global.SHAPES = [];
|
||||
|
||||
enum SHAPE_TYPE {
|
||||
points,
|
||||
triangles,
|
||||
}
|
||||
|
||||
function SHAPE_rectangle(_sca) {
|
||||
var triangles = [
|
||||
[[-_sca[0], -_sca[1]], [ _sca[0], -_sca[1]], [-_sca[0], _sca[1]]],
|
||||
[[ _sca[0], -_sca[1]], [-_sca[0], _sca[1]], [ _sca[0], _sca[1]]],
|
||||
];
|
||||
return [{ type: SHAPE_TYPE.triangles, triangles: triangles }];
|
||||
}
|
||||
|
||||
function SHAPE_circle(_sca, data = {}) {
|
||||
var prec = max(3, data.side);
|
||||
var points = [];
|
||||
|
||||
for( var i = 0; i < prec; i++ )
|
||||
array_push(points, [ lengthdir_x(0.5, i / prec * 360) * _sca[0] * 2, lengthdir_y(0.5, i / prec * 360) * _sca[1] * 2 ]);
|
||||
|
||||
return [{ type: SHAPE_TYPE.points, points: points }];
|
||||
}
|
||||
|
||||
function SHAPE_star(_sca, data = {}) {
|
||||
var prec = max(3, data.side);
|
||||
var inner = data.inner;
|
||||
var triangles = [];
|
||||
|
||||
for( var i = 0; i < prec; i++ ) {
|
||||
var otx = lengthdir_x(0.5, i / prec * 360) * _sca[0] * 2;
|
||||
var oty = lengthdir_y(0.5, i / prec * 360) * _sca[1] * 2;
|
||||
|
||||
var inx = lengthdir_x(inner / 2, (i + 0.5) / prec * 360) * _sca[0] * 2;
|
||||
var iny = lengthdir_y(inner / 2, (i + 0.5) / prec * 360) * _sca[1] * 2;
|
||||
|
||||
array_push(triangles, [ [0, 0], [otx, oty], [inx, iny] ]);
|
||||
|
||||
var inx = lengthdir_x(inner / 2, (i - 0.5) / prec * 360) * _sca[0] * 2;
|
||||
var iny = lengthdir_y(inner / 2, (i - 0.5) / prec * 360) * _sca[1] * 2;
|
||||
|
||||
array_push(triangles, [ [0, 0], [otx, oty], [inx, iny] ]);
|
||||
}
|
||||
|
||||
return [{ type: SHAPE_TYPE.triangles, triangles: triangles }];
|
||||
}
|
||||
|
||||
function SHAPE_capsule(_sca, data = {}) {
|
||||
var rad = data.radius;
|
||||
var prec = max(2, data.side);
|
||||
var hh = _sca[1] * rad;
|
||||
var shapes = [];
|
||||
|
||||
var triangles = [
|
||||
[[-_sca[0] + _sca[1], -_sca[1]], [ _sca[0] - hh, -hh], [-_sca[0] + _sca[1], _sca[1]]],
|
||||
[[ _sca[0] - hh, -hh], [-_sca[0] + _sca[1], _sca[1]], [ _sca[0] - hh, hh]],
|
||||
];
|
||||
shapes[0] = { type: SHAPE_TYPE.triangles, triangles: triangles };
|
||||
|
||||
var triangles = [];
|
||||
var cx = -_sca[0] + _sca[1];
|
||||
var cy = 0;
|
||||
var ox, oy, nx, ny, oa, na;
|
||||
for( var i = 0; i <= prec; i++ ) {
|
||||
na = lerp(270, 90, i / prec);
|
||||
nx = cx + lengthdir_x(_sca[1], na);
|
||||
ny = cy + lengthdir_y(_sca[1], na);
|
||||
|
||||
if(i) array_push(triangles, [[cx, cy], [ox, oy], [nx, ny]]);
|
||||
|
||||
oa = na;
|
||||
ox = nx;
|
||||
oy = ny;
|
||||
}
|
||||
|
||||
shapes[1] = { type: SHAPE_TYPE.triangles, triangles: triangles };
|
||||
|
||||
var triangles = [];
|
||||
var cx = _sca[0] - hh;
|
||||
var cy = 0;
|
||||
var ox, oy, nx, ny, oa, na;
|
||||
for( var i = 0; i <= prec; i++ ) {
|
||||
na = lerp(-90, 90, i / prec);
|
||||
nx = cx + lengthdir_x(hh, na);
|
||||
ny = cy + lengthdir_y(hh, na);
|
||||
|
||||
if(i) array_push(triangles, [[cx, cy], [ox, oy], [nx, ny]]);
|
||||
|
||||
oa = na;
|
||||
ox = nx;
|
||||
oy = ny;
|
||||
}
|
||||
|
||||
shapes[2] = { type: SHAPE_TYPE.triangles, triangles: triangles };
|
||||
|
||||
return shapes;
|
||||
}
|
||||
|
||||
function SHAPE_ring(_sca, data = {}) {
|
||||
var prec = max(3, data.side);
|
||||
var inner = data.inner;
|
||||
var triangles = [];
|
||||
|
||||
for( var i = 0; i < prec; i++ ) {
|
||||
var ix0 = lengthdir_x(0.5 * inner, i / prec * 360) * _sca[0] * 2;
|
||||
var iy0 = lengthdir_y(0.5 * inner, i / prec * 360) * _sca[1] * 2;
|
||||
|
||||
var nx0 = lengthdir_x(0.5, i / prec * 360) * _sca[0] * 2;
|
||||
var ny0 = lengthdir_y(0.5, i / prec * 360) * _sca[1] * 2;
|
||||
|
||||
var ix1 = lengthdir_x(0.5 * inner, (i + 1) / prec * 360) * _sca[0] * 2;
|
||||
var iy1 = lengthdir_y(0.5 * inner, (i + 1) / prec * 360) * _sca[1] * 2;
|
||||
|
||||
var nx1 = lengthdir_x(0.5, (i + 1) / prec * 360) * _sca[0] * 2;
|
||||
var ny1 = lengthdir_y(0.5, (i + 1) / prec * 360) * _sca[1] * 2;
|
||||
|
||||
array_push(triangles, [[ix0, iy0], [nx0, ny0], [nx1, ny1]]);
|
||||
array_push(triangles, [[ix0, iy0], [nx1, ny1], [ix1, iy1]]);
|
||||
}
|
||||
|
||||
return [{ type: SHAPE_TYPE.triangles, triangles: triangles }];
|
||||
}
|
||||
|
||||
function SHAPE_gear(_sca, data = {}) {
|
||||
var teeth = max(3, data.teeth);
|
||||
var teethH = data.teethH;
|
||||
var teethT = data.teethT;
|
||||
var prec = teeth * 2;
|
||||
var inner = data.inner;
|
||||
var body = 0.5 * (1 - teethH);
|
||||
var teth = 0.5 * teethH;
|
||||
var triangles = [];
|
||||
|
||||
for( var i = 0; i < prec; i++ ) {
|
||||
var ix0 = lengthdir_x(body * inner, i / prec * 360) * _sca[0] * 2;
|
||||
var iy0 = lengthdir_y(body * inner, i / prec * 360) * _sca[1] * 2;
|
||||
|
||||
var nx0 = lengthdir_x(body, i / prec * 360) * _sca[0] * 2;
|
||||
var ny0 = lengthdir_y(body, i / prec * 360) * _sca[1] * 2;
|
||||
|
||||
var ix1 = lengthdir_x(body * inner, (i + 1) / prec * 360) * _sca[0] * 2;
|
||||
var iy1 = lengthdir_y(body * inner, (i + 1) / prec * 360) * _sca[1] * 2;
|
||||
|
||||
var nx1 = lengthdir_x(body, (i + 1) / prec * 360) * _sca[0] * 2;
|
||||
var ny1 = lengthdir_y(body, (i + 1) / prec * 360) * _sca[1] * 2;
|
||||
|
||||
array_push(triangles, [[ix0, iy0], [nx0, ny0], [nx1, ny1]]);
|
||||
array_push(triangles, [[ix0, iy0], [nx1, ny1], [ix1, iy1]]);
|
||||
|
||||
if(i % 2) {
|
||||
var tx0 = nx0 + lengthdir_x(teth, (i + 0.5 - teethT) / prec * 360) * _sca[0] * 2;
|
||||
var ty0 = ny0 + lengthdir_y(teth, (i + 0.5 - teethT) / prec * 360) * _sca[1] * 2;
|
||||
|
||||
var tx1 = nx1 + lengthdir_x(teth, (i + 0.5 + teethT) / prec * 360) * _sca[0] * 2;
|
||||
var ty1 = ny1 + lengthdir_y(teth, (i + 0.5 + teethT) / prec * 360) * _sca[1] * 2;
|
||||
|
||||
array_push(triangles, [[tx0, ty0], [nx0, ny0], [nx1, ny1]]);
|
||||
array_push(triangles, [[tx0, ty0], [nx1, ny1], [tx1, ty1]]);
|
||||
}
|
||||
}
|
||||
|
||||
return [{ type: SHAPE_TYPE.triangles, triangles: triangles }];
|
||||
}
|
||||
|
||||
function SHAPE_cross(_sca, data = {}) {
|
||||
var inner = data.inner;
|
||||
var triangles = [];
|
||||
var side = min(_sca[0], _sca[1]) * inner;
|
||||
|
||||
array_push(triangles,
|
||||
[[-side, -_sca[1]], [ side, -_sca[1]], [-side, _sca[1]]],
|
||||
[[ side, -_sca[1]], [-side, _sca[1]], [ side, _sca[1]]],
|
||||
);
|
||||
|
||||
array_push(triangles,
|
||||
[[-_sca[0], -side], [ _sca[0], -side], [-_sca[0], side]],
|
||||
[[ _sca[0], -side], [-_sca[0], side], [ _sca[0], side]],
|
||||
);
|
||||
|
||||
return [{ type: SHAPE_TYPE.triangles, triangles: triangles }];
|
||||
}
|
||||
|
||||
function SHAPE_arc(_sca, data = {}) {
|
||||
var prec = max(3, data.side);
|
||||
var inner = data.inner;
|
||||
var radRan = data.radRan;
|
||||
var cap = data.cap;
|
||||
var triangles = [];
|
||||
|
||||
var oa, na;
|
||||
for( var i = 0; i <= prec; i++ ) {
|
||||
na = lerp(radRan[0], radRan[1], i / prec);
|
||||
|
||||
if(i) {
|
||||
var ix0 = lengthdir_x(0.5 * inner, oa) * _sca[0] * 2;
|
||||
var iy0 = lengthdir_y(0.5 * inner, oa) * _sca[1] * 2;
|
||||
|
||||
var nx0 = lengthdir_x(0.5, oa) * _sca[0] * 2;
|
||||
var ny0 = lengthdir_y(0.5, oa) * _sca[1] * 2;
|
||||
|
||||
var ix1 = lengthdir_x(0.5 * inner, na) * _sca[0] * 2;
|
||||
var iy1 = lengthdir_y(0.5 * inner, na) * _sca[1] * 2;
|
||||
|
||||
var nx1 = lengthdir_x(0.5, na) * _sca[0] * 2;
|
||||
var ny1 = lengthdir_y(0.5, na) * _sca[1] * 2;
|
||||
|
||||
array_push(triangles, [[ix0, iy0], [nx0, ny0], [nx1, ny1]]);
|
||||
array_push(triangles, [[ix0, iy0], [nx1, ny1], [ix1, iy1]]);
|
||||
}
|
||||
|
||||
oa = na;
|
||||
}
|
||||
|
||||
if(cap) {
|
||||
var cx = lengthdir_x(0.5 * (inner + 1) / 2, radRan[0]) * _sca[0] * 2;
|
||||
var cy = lengthdir_y(0.5 * (inner + 1) / 2, radRan[0]) * _sca[1] * 2;
|
||||
var ox, oy, nx, ny, oa, na;
|
||||
|
||||
for( var i = 0; i <= prec; i++ ) {
|
||||
na = radRan[0] - 180 * i / prec;
|
||||
nx = cx + lengthdir_x((1 - inner) / 2, na) * _sca[0];
|
||||
ny = cy + lengthdir_y((1 - inner) / 2, na) * _sca[1];
|
||||
|
||||
if(i) array_push(triangles, [[cx, cy], [ox, oy], [nx, ny]]);
|
||||
|
||||
oa = na;
|
||||
ox = nx;
|
||||
oy = ny;
|
||||
}
|
||||
|
||||
var cx = lengthdir_x(0.5 * (inner + 1) / 2, radRan[1]) * _sca[0] * 2;
|
||||
var cy = lengthdir_y(0.5 * (inner + 1) / 2, radRan[1]) * _sca[1] * 2;
|
||||
var ox, oy, nx, ny, oa, na;
|
||||
|
||||
for( var i = 0; i <= prec; i++ ) {
|
||||
na = radRan[1] + 180 * i / prec;
|
||||
nx = cx + lengthdir_x((1 - inner) / 2, na) * _sca[0];
|
||||
ny = cy + lengthdir_y((1 - inner) / 2, na) * _sca[1];
|
||||
|
||||
if(i) array_push(triangles, [[cx, cy], [ox, oy], [nx, ny]]);
|
||||
|
||||
oa = na;
|
||||
ox = nx;
|
||||
oy = ny;
|
||||
}
|
||||
}
|
||||
|
||||
return [{ type: SHAPE_TYPE.triangles, triangles: triangles }];
|
||||
}
|
||||
|
||||
#endregion
|
11
scripts/__shapes/__shapes.yy
Normal file
11
scripts/__shapes/__shapes.yy
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"resourceType": "GMScript",
|
||||
"resourceVersion": "1.0",
|
||||
"name": "__shapes",
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "draw",
|
||||
"path": "folders/functions/draw.yy",
|
||||
},
|
||||
}
|
23
scripts/draw_circle_angle/draw_circle_angle.gml
Normal file
23
scripts/draw_circle_angle/draw_circle_angle.gml
Normal file
|
@ -0,0 +1,23 @@
|
|||
function draw_circle_angle(_x, _y, _r, _angSt, _angEd, precision = 32) {
|
||||
var ox, oy, nx, ny, oa, na;
|
||||
|
||||
draw_primitive_begin(pr_trianglelist);
|
||||
|
||||
for( var i = 0; i <= precision; i++ ) {
|
||||
na = lerp(_angSt, _angEd, i / precision);
|
||||
nx = _x + lengthdir_x(_r, na);
|
||||
ny = _y + lengthdir_y(_r, na);
|
||||
|
||||
if(i) {
|
||||
draw_vertex(_x, _y);
|
||||
draw_vertex(ox, oy);
|
||||
draw_vertex(nx, ny);
|
||||
}
|
||||
|
||||
oa = na;
|
||||
ox = nx;
|
||||
oy = ny;
|
||||
}
|
||||
|
||||
draw_primitive_end();
|
||||
}
|
11
scripts/draw_circle_angle/draw_circle_angle.yy
Normal file
11
scripts/draw_circle_angle/draw_circle_angle.yy
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"resourceType": "GMScript",
|
||||
"resourceVersion": "1.0",
|
||||
"name": "draw_circle_angle",
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "draw",
|
||||
"path": "folders/functions/draw.yy",
|
||||
},
|
||||
}
|
|
@ -23,17 +23,18 @@ function draw_line_width2(x0, y0, x1, y1, w0, w1, cap = false) {
|
|||
}
|
||||
}
|
||||
|
||||
function draw_line_width2_angle(x0, y0, x1, y1, w0, w1, a0 = 0, a1 = 0) {
|
||||
function draw_line_width2_angle(x0, y0, x1, y1, w0, w1, a0 = 0, a1 = 0, _oc = c_white, _nc = c_white) {
|
||||
var _x0 = x0 + lengthdir_x(w0 / 2, a0);
|
||||
var _y0 = y0 + lengthdir_y(w0 / 2, a0);
|
||||
var _x1 = x1 + lengthdir_x(w1 / 2, a1);
|
||||
var _y1 = y1 + lengthdir_y(w1 / 2, a1);
|
||||
|
||||
//draw_set_color(c_red);
|
||||
draw_primitive_begin(pr_trianglestrip);
|
||||
draw_vertex( x0, y0);
|
||||
draw_vertex( x1, y1);
|
||||
draw_vertex(_x0, _y0);
|
||||
draw_vertex(_x1, _y1);
|
||||
draw_vertex_color( x0, y0, _oc, 1);
|
||||
draw_vertex_color( x1, y1, _nc, 1);
|
||||
draw_vertex_color(_x0, _y0, _oc, 1);
|
||||
draw_vertex_color(_x1, _y1, _nc, 1);
|
||||
draw_primitive_end();
|
||||
|
||||
var _x0 = x0 + lengthdir_x(w0 / 2, a0 + 180);
|
||||
|
@ -41,10 +42,11 @@ function draw_line_width2_angle(x0, y0, x1, y1, w0, w1, a0 = 0, a1 = 0) {
|
|||
var _x1 = x1 + lengthdir_x(w1 / 2, a1 + 180);
|
||||
var _y1 = y1 + lengthdir_y(w1 / 2, a1 + 180);
|
||||
|
||||
//draw_set_color(c_blue);
|
||||
draw_primitive_begin(pr_trianglestrip);
|
||||
draw_vertex( x0, y0);
|
||||
draw_vertex( x1, y1);
|
||||
draw_vertex(_x0, _y0);
|
||||
draw_vertex(_x1, _y1);
|
||||
draw_vertex_color( x0, y0, _oc, 1);
|
||||
draw_vertex_color( x1, y1, _nc, 1);
|
||||
draw_vertex_color(_x0, _y0, _oc, 1);
|
||||
draw_vertex_color(_x1, _y1, _nc, 1);
|
||||
draw_primitive_end();
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
globalvar BLEND_TYPES;
|
||||
BLEND_TYPES = [ "Normal", "Add", "Subtract", "Multiply", "Screen", "Overlay", "Hue", "Saturation", "Luminosity", "Maximum", "Minimum" ];
|
||||
BLEND_TYPES = [ "Normal", "Add", "Subtract", "Multiply", "Screen", "Overlay", "Hue", "Saturation", "Luminosity", "Maximum", "Minimum", "Replace" ];
|
||||
|
||||
function draw_surface_blend(background, foreground, blend, alpha, _pre_alp = true, _mask = 0, tile = 0) {
|
||||
if(!is_surface(background)) return;
|
||||
|
@ -18,6 +18,7 @@ function draw_surface_blend(background, foreground, blend, alpha, _pre_alp = tru
|
|||
|
||||
case "Maximum" : sh = sh_blend_max; break;
|
||||
case "Minimum" : sh = sh_blend_min; break;
|
||||
case "Replace" : sh = sh_blend_replace; break;
|
||||
default: return;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,6 +21,10 @@ function lerp_linear(from, to, speed) {
|
|||
return from + sign(to - from) * speed;
|
||||
}
|
||||
|
||||
function lerp_angle_direct(from, to, speed) {
|
||||
return from + angle_difference(to, from) * speed;
|
||||
}
|
||||
|
||||
function lerp_angle(from, to, speed) {
|
||||
if(fps < 15) return to;
|
||||
return from + angle_difference(to, from) * (1 - power(1 - 1 / speed, delta_time / 1000000 * room_speed));
|
||||
|
|
|
@ -30,7 +30,7 @@ function Node_Blend(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constr
|
|||
inputs[| 8] = nodeValue("Active", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true);
|
||||
active_index = 8;
|
||||
|
||||
inputs[| 9] = nodeValue("Preserve alpha", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true);
|
||||
inputs[| 9] = nodeValue("Preserve alpha", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false);
|
||||
|
||||
inputs[| 10] = nodeValue("Horizontal Align", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
.setDisplay(VALUE_DISPLAY.enum_button, [ THEME.inspector_surface_halign, THEME.inspector_surface_halign, THEME.inspector_surface_halign]);
|
||||
|
|
21
scripts/node_cache_array/node_cache_array.gml
Normal file
21
scripts/node_cache_array/node_cache_array.gml
Normal file
|
@ -0,0 +1,21 @@
|
|||
function Node_Cache_Array(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
||||
name = "Cache Array";
|
||||
use_cache = true;
|
||||
|
||||
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
|
||||
outputs[| 0] = nodeValue("Cache array", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, []);
|
||||
|
||||
input_display_list = [
|
||||
["Surface", true], 0,
|
||||
];
|
||||
|
||||
static update = function() {
|
||||
if(!inputs[| 0].value_from) return;
|
||||
if(!ANIMATOR.is_playing) return;
|
||||
|
||||
var _surf = inputs[| 0].getValue();
|
||||
cacheCurrentFrame(_surf);
|
||||
outputs[| 0].setValue(cached_output);
|
||||
}
|
||||
}
|
11
scripts/node_cache_array/node_cache_array.yy
Normal file
11
scripts/node_cache_array/node_cache_array.yy
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"resourceType": "GMScript",
|
||||
"resourceVersion": "1.0",
|
||||
"name": "node_cache_array",
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "node",
|
||||
"path": "folders/nodes/data/node.yy",
|
||||
},
|
||||
}
|
12
scripts/node_cache_array/node_outline.yy
Normal file
12
scripts/node_cache_array/node_outline.yy
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "process",
|
||||
"path": "folders/nodes/data/process.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "node_outline",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
|
@ -61,6 +61,8 @@ function upgroupNode(collection, record = true) {
|
|||
function Node_Collection(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
||||
nodes = ds_list_create();
|
||||
ungroupable = true;
|
||||
auto_render_time = false;
|
||||
combine_render_time = true;
|
||||
|
||||
custom_input_index = 0;
|
||||
custom_output_index = 0;
|
||||
|
@ -80,6 +82,7 @@ function Node_Collection(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
|
|||
static getNextNodes = function() {
|
||||
for(var i = custom_input_index; i < ds_list_size(inputs); i++) {
|
||||
var _in = inputs[| i].from;
|
||||
if(!_in.renderActive) continue;
|
||||
|
||||
ds_queue_enqueue(RENDER_QUEUE, _in);
|
||||
printIf(global.RENDER_LOG, "Push group input " + _in.name + " to stack");
|
||||
|
@ -183,10 +186,12 @@ function Node_Collection(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
|
|||
}
|
||||
|
||||
static step = function() {
|
||||
render_time = 0;
|
||||
if(combine_render_time) render_time = 0;
|
||||
|
||||
for(var i = 0; i < ds_list_size(nodes); i++) {
|
||||
nodes[| i].step();
|
||||
render_time += nodes[| i].render_time;
|
||||
if(combine_render_time)
|
||||
render_time += nodes[| i].render_time;
|
||||
}
|
||||
|
||||
if(PANEL_GRAPH.node_focus == self && panelFocus(PANEL_GRAPH) && DOUBLE_CLICK) {
|
||||
|
|
|
@ -2,6 +2,7 @@ global.loop_nodes = [ "Node_Iterate", "Node_Iterate_Each" ];
|
|||
|
||||
function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
|
||||
active = true;
|
||||
renderActive = true;
|
||||
node_id = generateUUID();
|
||||
group = _group;
|
||||
destroy_when_upgroup = false;
|
||||
|
@ -59,6 +60,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
|
|||
rendered = false;
|
||||
update_on_frame = false;
|
||||
render_time = 0;
|
||||
auto_render_time = true;
|
||||
|
||||
use_cache = false;
|
||||
cached_output = [];
|
||||
|
@ -252,7 +254,8 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
|
|||
var t = get_timer();
|
||||
update();
|
||||
setRenderStatus(true);
|
||||
render_time = get_timer() - t;
|
||||
if(auto_render_time)
|
||||
render_time = get_timer() - t;
|
||||
} catch(exception) {
|
||||
var sCurr = surface_get_target();
|
||||
while(surface_get_target() != sBase)
|
||||
|
@ -277,8 +280,12 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
|
|||
|
||||
for(var j = 0; j < ds_list_size(inputs); j++) {
|
||||
var _in = inputs[| j];
|
||||
if(_in.value_from == noone) continue;
|
||||
if (!_in.value_from.node.rendered)
|
||||
var val_from = _in.value_from;
|
||||
if(val_from == noone) continue;
|
||||
if(!val_from.node.active) continue;
|
||||
if(!val_from.node.renderActive) continue;
|
||||
|
||||
if (!val_from.node.rendered)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -355,7 +362,8 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
|
|||
|
||||
static drawNodeBase = function(xx, yy, _s) {
|
||||
if(!active) return;
|
||||
draw_sprite_stretched_ext(bg_spr, 0, xx, yy, w * _s, h * _s, color, 0.75);
|
||||
var aa = 0.25 + 0.5 * renderActive;
|
||||
draw_sprite_stretched_ext(bg_spr, 0, xx, yy, w * _s, h * _s, color, aa);
|
||||
}
|
||||
|
||||
static drawGetBbox = function(xx, yy, _s) {
|
||||
|
@ -377,13 +385,15 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
|
|||
|
||||
static drawNodeName = function(xx, yy, _s) {
|
||||
if(!active) return;
|
||||
|
||||
draw_name = false;
|
||||
var _name = display_name == ""? name : display_name;
|
||||
if(_name == "") return;
|
||||
if(_s < 0.75) return;
|
||||
draw_name = true;
|
||||
|
||||
draw_sprite_stretched_ext(THEME.node_bg_name, 0, xx, yy, w * _s, ui(20), color, 0.75);
|
||||
var aa = 0.25 + 0.5 * renderActive;
|
||||
draw_sprite_stretched_ext(THEME.node_bg_name, 0, xx, yy, w * _s, ui(20), color, aa);
|
||||
|
||||
var cc = COLORS._main_text;
|
||||
if(PREF_MAP[? "node_show_render_status"] && !rendered)
|
||||
|
@ -394,11 +404,16 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
|
|||
if(hasInspectorUpdate()) icon = THEME.refresh_s;
|
||||
var ts = clamp(power(_s, 0.5), 0.5, 1);
|
||||
|
||||
var aa = 0.5 + 0.5 * renderActive;
|
||||
draw_set_alpha(aa);
|
||||
|
||||
if(icon && _s > 0.75) {
|
||||
draw_sprite_ui_uniform(icon, 0, xx + ui(12), yy + ui(10));
|
||||
draw_sprite_ui_uniform(icon, 0, xx + ui(12), yy + ui(10),,, aa);
|
||||
draw_text_cut(xx + ui(24), yy + ui(10), _name, w * _s - ui(24), ts);
|
||||
} else
|
||||
draw_text_cut(xx + ui(8), yy + ui(10), _name, w * _s - ui(8), ts);
|
||||
|
||||
draw_set_alpha(1);
|
||||
}
|
||||
|
||||
static drawJunctions = function(_x, _y, _mx, _my, _s) {
|
||||
|
@ -552,8 +567,9 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
|
|||
var ps = min((w * _s - 8) / pw, (h * _s - 8) / ph);
|
||||
var px = xx + w * _s / 2 - pw * ps / 2;
|
||||
var py = yy + h * _s / 2 - ph * ps / 2;
|
||||
|
||||
draw_surface_ext_safe(surf, px, py, ps, ps, 0, c_white, 1);
|
||||
|
||||
var aa = 0.5 + 0.5 * renderActive;
|
||||
draw_surface_ext_safe(surf, px, py, ps, ps, 0, c_white, aa);
|
||||
}
|
||||
|
||||
static getNodeDimension = function() {
|
||||
|
@ -725,6 +741,9 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
|
|||
static onDestroy = function() {}
|
||||
|
||||
static isRenderable = function(trigger = false) {
|
||||
if(!active) return false;
|
||||
if(!renderActive) return false;
|
||||
|
||||
var _startNode = true;
|
||||
for(var j = 0; j < ds_list_size(inputs); j++) {
|
||||
var _in = inputs[| j];
|
||||
|
@ -732,8 +751,9 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
|
|||
|
||||
if(trigger)
|
||||
triggerRender();
|
||||
|
||||
if(_in.value_from != noone && !_in.value_from.node.rendered)
|
||||
|
||||
var val_from = _in.value_from;
|
||||
if(val_from != noone && !val_from.node.rendered && val_from.node.active && val_from.node.renderActive)
|
||||
_startNode = false;
|
||||
}
|
||||
return _startNode;
|
||||
|
@ -746,6 +766,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
|
|||
|
||||
for(var j = 0; j < ds_list_size(_ot.value_to); j++) {
|
||||
var _to = _ot.value_to[| j];
|
||||
if(!_to.node.renderActive) continue;
|
||||
if(!_to.node.active || _to.value_from == noone) continue;
|
||||
if(_to.value_from.node != self) continue;
|
||||
|
||||
|
@ -776,23 +797,24 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
|
|||
cacheArrayCheck();
|
||||
if(ANIMATOR.current_frame > ANIMATOR.frames_total) return;
|
||||
|
||||
var _os = cached_output[ANIMATOR.current_frame];
|
||||
if(is_surface(_os))
|
||||
surface_copy_size(_os, _frame);
|
||||
else {
|
||||
_os = surface_clone(_frame);
|
||||
cached_output[ANIMATOR.current_frame] = _os;
|
||||
}
|
||||
cached_output[ANIMATOR.current_frame] = surface_clone(_frame, cached_output[ANIMATOR.current_frame]);
|
||||
|
||||
array_safe_set(cache_result, ANIMATOR.current_frame, true);
|
||||
}
|
||||
|
||||
static cacheExist = function(frame = ANIMATOR.current_frame) {
|
||||
if(frame >= array_length(cached_output)) return false;
|
||||
if(frame >= array_length(cache_result)) return false;
|
||||
if(!array_safe_get(cache_result, frame)) return false;
|
||||
//if(!array_safe_get(cache_result, frame)) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
static getCacheFrame = function(frame = ANIMATOR.current_frame) {
|
||||
if(!cacheExist(frame)) return noone;
|
||||
var surf = array_safe_get(cached_output, frame);
|
||||
return surf;
|
||||
}
|
||||
|
||||
static recoverCache = function(frame = ANIMATOR.current_frame) {
|
||||
if(!cacheExist(frame)) return false;
|
||||
|
||||
|
@ -810,6 +832,8 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
|
|||
return true;
|
||||
}
|
||||
static clearCache = function() {
|
||||
return;
|
||||
|
||||
if(array_length(cached_output) != ANIMATOR.frames_total + 1)
|
||||
array_resize(cached_output, ANIMATOR.frames_total + 1);
|
||||
for(var i = 0; i < array_length(cached_output); i++) {
|
||||
|
@ -904,12 +928,13 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
|
|||
var _map = ds_map_create();
|
||||
|
||||
if(!preset) {
|
||||
_map[? "id"] = node_id;
|
||||
_map[? "name"] = display_name;
|
||||
_map[? "x"] = x;
|
||||
_map[? "y"] = y;
|
||||
_map[? "type"] = instanceof(self);
|
||||
_map[? "group"] = group == -1? -1 : group.node_id;
|
||||
_map[? "id"] = node_id;
|
||||
_map[? "render"] = renderActive;
|
||||
_map[? "name"] = display_name;
|
||||
_map[? "x"] = x;
|
||||
_map[? "y"] = y;
|
||||
_map[? "type"] = instanceof(self);
|
||||
_map[? "group"] = group == -1? -1 : group.node_id;
|
||||
}
|
||||
|
||||
ds_map_add_map(_map, "attri", attributeSerialize());
|
||||
|
@ -950,6 +975,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
|
|||
|
||||
x = ds_map_try_get(load_map, "x");
|
||||
y = ds_map_try_get(load_map, "y");
|
||||
renderActive = ds_map_try_get(load_map, "render", true);
|
||||
}
|
||||
|
||||
if(ds_map_exists(load_map, "attri"))
|
||||
|
|
|
@ -43,6 +43,7 @@ function Node_Export(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
inputs[| 3] = nodeValue("Type", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
.setDisplay(VALUE_DISPLAY.enum_scroll, format_single)
|
||||
.rejectArray();
|
||||
inputs[| 3].editWidget.update_hover = false;
|
||||
|
||||
inputs[| 4] = nodeValue("Template guides", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
.setDisplay(VALUE_DISPLAY.label,
|
||||
|
@ -74,6 +75,7 @@ function Node_Export(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
inputs[| 9] = nodeValue("Format", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
.setDisplay(VALUE_DISPLAY.enum_scroll, format_image)
|
||||
.rejectArray();
|
||||
inputs[| 9].editWidget.update_hover = false;
|
||||
|
||||
inputs[| 10] = nodeValue("Quality", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 80)
|
||||
.setDisplay(VALUE_DISPLAY.slider, [0, 100, 1])
|
||||
|
|
|
@ -22,6 +22,8 @@ function Node_Feedback(_x, _y, _group = -1) : Node_Collection(_x, _y, _group) co
|
|||
var allReady = true;
|
||||
for(var i = custom_input_index; i < ds_list_size(inputs); i++) {
|
||||
var _in = inputs[| i].from;
|
||||
if(!_in.renderActive) continue;
|
||||
|
||||
allReady &= _in.isUpdateReady()
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
function Node_Feedback_Input(_x, _y, _group = -1) : Node_Group_Input(_x, _y, _group) constructor {
|
||||
name = "Input";
|
||||
name = "Feedback Input";
|
||||
color = COLORS.node_blend_feedback;
|
||||
|
||||
w = 96;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
function Node_Feedback_Output(_x, _y, _group = -1) : Node_Group_Output(_x, _y, _group) constructor {
|
||||
name = "Output";
|
||||
name = "Feedback Output";
|
||||
color = COLORS.node_blend_feedback;
|
||||
|
||||
w = 96;
|
||||
|
|
|
@ -1,2 +1,132 @@
|
|||
#macro def_surf_size PREF_MAP[? "default_surface_side"]
|
||||
#macro def_surf_size2 [PREF_MAP[? "default_surface_side"], PREF_MAP[? "default_surface_side"]]
|
||||
|
||||
#region
|
||||
function node_draw_transform_init() {
|
||||
drag_type = -1;
|
||||
dragging_sx = 0;
|
||||
dragging_sy = 0;
|
||||
dragging_mx = 0;
|
||||
dragging_my = 0;
|
||||
rot_anc_x = 0;
|
||||
rot_anc_y = 0;
|
||||
}
|
||||
|
||||
function node_draw_transform_box(active, _x, _y, _s, _mx, _my, _snx, _sny, _posInd, _rotInd, _scaInd) {
|
||||
var _pos = inputs[| _posInd].getValue();
|
||||
var _rot = inputs[| _rotInd].getValue();
|
||||
var _sca = inputs[| _scaInd].getValue();
|
||||
|
||||
if(drag_type > -1) {
|
||||
if(drag_type == 0) {
|
||||
var _dx = (_mx - dragging_mx) / _s;
|
||||
var _dy = (_my - dragging_my) / _s;
|
||||
|
||||
if(key_mod_press(SHIFT)) {
|
||||
if(abs(_dx) > abs(_dy) + ui(16))
|
||||
_dy = 0;
|
||||
else if(abs(_dy) > abs(_dx) + ui(16))
|
||||
_dx = 0;
|
||||
else {
|
||||
_dx = max(_dx, _dy);
|
||||
_dy = _dx;
|
||||
}
|
||||
}
|
||||
|
||||
_pos[0] = value_snap(dragging_sx + _dx, _snx);
|
||||
_pos[1] = value_snap(dragging_sy + _dy, _sny);
|
||||
|
||||
if(inputs[| _posInd].setValue(_pos))
|
||||
UNDO_HOLDING = true;
|
||||
|
||||
if(inputs[| _posInd].unit.mode == VALUE_UNIT.reference) {
|
||||
var p = [ _pos[0], _pos[1] ];
|
||||
_pos = inputs[| _posInd].unit.apply(p);
|
||||
}
|
||||
} else if(drag_type == 1) {
|
||||
var aa = point_direction(rot_anc_x, rot_anc_y, _mx, _my);
|
||||
var da = angle_difference(dragging_mx, aa);
|
||||
|
||||
if(key_mod_press(CTRL))
|
||||
_rot = round((dragging_sx - da) / 15) * 15;
|
||||
else
|
||||
_rot = dragging_sx - da;
|
||||
|
||||
if(inputs[| _rotInd].setValue(_rot))
|
||||
UNDO_HOLDING = true;
|
||||
} else if(drag_type == 2) {
|
||||
var _p = point_rotate(_mx - dragging_mx, _my - dragging_my, 0, 0, -_rot);
|
||||
_sca[0] = _p[0] / _s;
|
||||
_sca[1] = _p[1] / _s;
|
||||
|
||||
if(key_mod_press(SHIFT)) {
|
||||
_sca[0] = min(_sca[0], _sca[1]);
|
||||
_sca[1] = min(_sca[0], _sca[1]);
|
||||
}
|
||||
|
||||
if(inputs[| _scaInd].setValue(_sca))
|
||||
UNDO_HOLDING = true;
|
||||
}
|
||||
|
||||
if(mouse_release(mb_left)) {
|
||||
drag_type = -1;
|
||||
UNDO_HOLDING = false;
|
||||
}
|
||||
}
|
||||
|
||||
var p0 = point_rotate(-_sca[0], -_sca[1], 0, 0, _rot);
|
||||
var p1 = point_rotate( _sca[0], -_sca[1], 0, 0, _rot);
|
||||
var p2 = point_rotate(-_sca[0], _sca[1], 0, 0, _rot);
|
||||
var p3 = point_rotate( _sca[0], _sca[1], 0, 0, _rot);
|
||||
var pr = point_rotate( 0, -_sca[1] - 1, 0, 0, _rot);
|
||||
|
||||
var pd0x = _x + (p0[0] + _pos[0]) * _s; var pd0y = _y + (p0[1] + _pos[1]) * _s;
|
||||
var pd1x = _x + (p1[0] + _pos[0]) * _s; var pd1y = _y + (p1[1] + _pos[1]) * _s;
|
||||
var pd2x = _x + (p2[0] + _pos[0]) * _s; var pd2y = _y + (p2[1] + _pos[1]) * _s;
|
||||
var pd3x = _x + (p3[0] + _pos[0]) * _s; var pd3y = _y + (p3[1] + _pos[1]) * _s;
|
||||
var prx = _x + (pr[0] + _pos[0]) * _s; var pry = _y + (pr[1] + _pos[1]) * _s;
|
||||
|
||||
var hovering = -1;
|
||||
|
||||
if(drag_type == -1) {
|
||||
if(point_in_rectangle_points(_mx, _my, pd0x, pd0y, pd1x, pd1y, pd2x, pd2y, pd3x, pd3y))
|
||||
hovering = 0;
|
||||
if(point_in_circle(_mx, _my, prx, pry, 12))
|
||||
hovering = 1;
|
||||
if(point_in_circle(_mx, _my, pd3x, pd3y, 12))
|
||||
hovering = 2;
|
||||
}
|
||||
|
||||
draw_set_color(COLORS._main_accent);
|
||||
draw_line_width(pd0x, pd0y, pd1x, pd1y, hovering == 0? 2 : 1);
|
||||
draw_line_width(pd0x, pd0y, pd2x, pd2y, hovering == 0? 2 : 1);
|
||||
draw_line_width(pd3x, pd3y, pd1x, pd1y, hovering == 0? 2 : 1);
|
||||
draw_line_width(pd3x, pd3y, pd2x, pd2y, hovering == 0? 2 : 1);
|
||||
|
||||
draw_sprite_ui_uniform(THEME.anchor_rotate, hovering == 1, prx, pry,,,, _rot);
|
||||
draw_sprite_ui_uniform(THEME.anchor_scale, hovering == 2, pd3x, pd3y,,,, _rot);
|
||||
|
||||
if(hovering == -1) return;
|
||||
if(drag_type > -1) return;
|
||||
|
||||
if(mouse_press(mb_left, active)) {
|
||||
drag_type = hovering;
|
||||
if(hovering == 0) {
|
||||
dragging_sx = _pos[0];
|
||||
dragging_sy = _pos[1];
|
||||
dragging_mx = _mx;
|
||||
dragging_my = _my;
|
||||
} else if(hovering == 1) { //rot
|
||||
dragging_sx = _rot;
|
||||
rot_anc_x = _x + _pos[0] * _s;
|
||||
rot_anc_y = _y + _pos[1] * _s;
|
||||
dragging_mx = point_direction(rot_anc_x, rot_anc_y, _mx, _my);
|
||||
} else if(hovering == 2) { //sca
|
||||
dragging_sx = _sca[0];
|
||||
dragging_sy = _sca[1];
|
||||
dragging_mx = _x + _pos[0] * _s;
|
||||
dragging_my = _y + _pos[1] * _s;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
|
@ -81,7 +81,7 @@ function Node_Grid(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constru
|
|||
shader_set_uniform_f(uniform_wid, _wid);
|
||||
shader_set_uniform_f(uniform_ang, degtorad(_ang));
|
||||
shader_set_uniform_f(uniform_sam, is_surface(_sam));
|
||||
shader_set_uniform_f(uniform_shf, _shf);
|
||||
shader_set_uniform_f(uniform_shf, _shx? _shf / _sca[1] : _shf / _sca[0]);
|
||||
shader_set_uniform_i(uniform_shx, _shx);
|
||||
shader_set_uniform_i(uniform_hgt, _hgt);
|
||||
shader_set_uniform_f_array_safe(uniform_col1, colToVec4(_col1));
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
function Node_Group_Input(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
||||
name = "Input";
|
||||
name = "Group Input";
|
||||
destroy_when_upgroup = true;
|
||||
color = COLORS.node_blend_collection;
|
||||
previewable = false;
|
||||
|
@ -39,6 +39,7 @@ function Node_Group_Input(_x, _y, _group = -1) : Node(_x, _y, _group) constructo
|
|||
inputs[| 2] = nodeValue("Input type", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Integer", "Float", "Boolean", "Color", "Surface", "Path", "Curve", "Text", "Object", "Node", "3D object", "Any" ])
|
||||
.rejectArray();
|
||||
inputs[| 2].editWidget.update_hover = false;
|
||||
|
||||
inputs[| 3] = nodeValue("Enum label", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, "")
|
||||
.setVisible(false)
|
||||
|
@ -48,6 +49,7 @@ function Node_Group_Input(_x, _y, _group = -1) : Node(_x, _y, _group) constructo
|
|||
.setDisplay(VALUE_DISPLAY.enum_button, [ "2", "3", "4" ])
|
||||
.setVisible(false)
|
||||
.rejectArray();
|
||||
inputs[| 2].editWidget.update_hover = false;
|
||||
|
||||
inputs[| 5] = nodeValue("Order", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
.rejectArray();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
function Node_Group_Output(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
||||
name = "Output";
|
||||
name = "Group Output";
|
||||
destroy_when_upgroup = true;
|
||||
color = COLORS.node_blend_collection;
|
||||
previewable = false;
|
||||
|
@ -31,6 +31,7 @@ function Node_Group_Output(_x, _y, _group = -1) : Node(_x, _y, _group) construct
|
|||
|
||||
for(var j = 0; j < ds_list_size(outParent.value_to); j++) {
|
||||
var _to = outParent.value_to[| j];
|
||||
if(!_to.node.renderActive) continue;
|
||||
printIf(global.RENDER_LOG, "Value to " + _to.name);
|
||||
|
||||
if(!_to.node.active || _to.value_from == noone) {
|
||||
|
|
|
@ -9,6 +9,7 @@ function Node_Iterate(_x, _y, _group = -1) : Node_Collection(_x, _y, _group) con
|
|||
color = COLORS.node_blend_loop;
|
||||
icon = THEME.loop;
|
||||
|
||||
combine_render_time = false;
|
||||
iterated = 0;
|
||||
|
||||
inputs[| 0] = nodeValue("Repeat", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 1 );
|
||||
|
@ -42,6 +43,8 @@ function Node_Iterate(_x, _y, _group = -1) : Node_Collection(_x, _y, _group) con
|
|||
var allReady = true;
|
||||
for(var i = custom_input_index; i < ds_list_size(inputs); i++) {
|
||||
var _in = inputs[| i].from;
|
||||
if(!_in.renderActive) continue;
|
||||
|
||||
allReady &= _in.isUpdateReady()
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ function Node_Iterate_Each(_x, _y, _group = -1) : Node_Collection(_x, _y, _group
|
|||
color = COLORS.node_blend_loop;
|
||||
icon = THEME.loop;
|
||||
|
||||
combine_render_time = false;
|
||||
iterated = 0;
|
||||
|
||||
inputs[| 0] = nodeValue("Array", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, [] )
|
||||
|
@ -36,12 +37,13 @@ function Node_Iterate_Each(_x, _y, _group = -1) : Node_Collection(_x, _y, _group
|
|||
iterated = 0;
|
||||
loop_start_time = get_timer();
|
||||
|
||||
var arrIn = inputs[| 0].getValue();
|
||||
var maxIter = is_array(arrIn)? array_length(arrIn) : 0;
|
||||
var arrOut = array_create(maxIter);
|
||||
outputs[| 0].setValue(arrOut);
|
||||
var arrIn = inputs[| 0].getValue();
|
||||
var arrOut = outputs[| 0].getValue();
|
||||
|
||||
//
|
||||
if(array_length(arrOut) != array_length(arrIn)) {
|
||||
surface_array_free(arrOut);
|
||||
outputs[| 0].setValue([])
|
||||
}
|
||||
|
||||
printIf(global.RENDER_LOG, " > Loop begin");
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
function Node_Iterator_Each_Input(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
||||
name = "Input";
|
||||
name = "Loop Input";
|
||||
color = COLORS.node_blend_loop;
|
||||
|
||||
manual_deletable = false;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
function Node_Iterator_Each_Output(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
||||
name = "Output";
|
||||
name = "Loop Output";
|
||||
color = COLORS.node_blend_loop;
|
||||
|
||||
manual_deletable = false;
|
||||
|
@ -24,6 +24,7 @@ function Node_Iterator_Each_Output(_x, _y, _group = -1) : Node(_x, _y, _group) c
|
|||
var _ot = group.outputs[| 0];
|
||||
for(var j = 0; j < ds_list_size(_ot.value_to); j++) {
|
||||
var _to = _ot.value_to[| j];
|
||||
if(!_to.node.renderActive) continue;
|
||||
|
||||
if(_to.node.active && _to.value_from != noone && _to.value_from.node == group) {
|
||||
_to.node.triggerRender();
|
||||
|
@ -47,13 +48,11 @@ function Node_Iterator_Each_Output(_x, _y, _group = -1) : Node(_x, _y, _group) c
|
|||
if(inputs[| 0].value_from == noone) return _prev_val;
|
||||
|
||||
var is_surf = inputs[| 0].value_from.type == VALUE_TYPE.surface;
|
||||
var _new_val;
|
||||
var _new_val = [];
|
||||
|
||||
surface_array_free(_prev_val);
|
||||
if(is_surf)
|
||||
_new_val = surface_array_clone(_val);
|
||||
else
|
||||
_new_val = array_clone(_val);
|
||||
if(is_surf) _new_val = surface_array_clone(_val);
|
||||
else _new_val = array_clone(_val);
|
||||
|
||||
return _new_val;
|
||||
}
|
||||
|
@ -69,7 +68,8 @@ function Node_Iterator_Each_Output(_x, _y, _group = -1) : Node(_x, _y, _group) c
|
|||
var _val = group.outputs[| 0].getValue();
|
||||
if(!is_array(_val)) return;
|
||||
|
||||
_val[ind] = cloneValue(array_safe_get(_val, ind), inputs[| 0].getValue());
|
||||
_val[@ ind] = cloneValue(array_safe_get(_val, ind), inputs[| 0].getValue());
|
||||
|
||||
group.outputs[| 0].setValue(_val);
|
||||
outputs[| 0].setValue(_val);
|
||||
}
|
||||
|
|
22
scripts/node_iterator_each_size/node_iterator_each_size.gml
Normal file
22
scripts/node_iterator_each_size/node_iterator_each_size.gml
Normal file
|
@ -0,0 +1,22 @@
|
|||
function Node_Iterator_Each_Length(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
||||
name = "Array Length";
|
||||
destroy_when_upgroup = true;
|
||||
color = COLORS.node_blend_loop;
|
||||
previewable = false;
|
||||
|
||||
w = 96;
|
||||
min_h = 80;
|
||||
|
||||
outputs[| 0] = nodeValue("Length", self, JUNCTION_CONNECT.output, VALUE_TYPE.integer, 0);
|
||||
|
||||
static update = function(frame = ANIMATOR.current_frame) {
|
||||
if(!variable_struct_exists(group, "iterated")) return;
|
||||
var val = group.inputs[| 0].getValue();
|
||||
outputs[| 0].setValue(array_length(val));
|
||||
}
|
||||
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s) {
|
||||
var bbox = drawGetBbox(xx, yy, _s);
|
||||
draw_sprite_fit(s_node_iterator_amount, 0, bbox.xc, bbox.yc, bbox.w, bbox.h);
|
||||
}
|
||||
}
|
11
scripts/node_iterator_each_size/node_iterator_each_size.yy
Normal file
11
scripts/node_iterator_each_size/node_iterator_each_size.yy
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"resourceType": "GMScript",
|
||||
"resourceVersion": "1.0",
|
||||
"name": "node_iterator_each_size",
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "for each",
|
||||
"path": "folders/nodes/data/iterate/for each.yy",
|
||||
},
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
function Node_Iterator_Input(_x, _y, _group = -1) : Node_Group_Input(_x, _y, _group) constructor {
|
||||
name = "Input";
|
||||
name = "Loop Input";
|
||||
color = COLORS.node_blend_loop;
|
||||
|
||||
local_output = noone;
|
||||
|
|
22
scripts/node_iterator_length/node_iterator_length.gml
Normal file
22
scripts/node_iterator_length/node_iterator_length.gml
Normal file
|
@ -0,0 +1,22 @@
|
|||
function Node_Iterator_Length(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
||||
name = "Loop Amount";
|
||||
destroy_when_upgroup = true;
|
||||
color = COLORS.node_blend_loop;
|
||||
previewable = false;
|
||||
|
||||
w = 96;
|
||||
min_h = 80;
|
||||
|
||||
outputs[| 0] = nodeValue("Length", self, JUNCTION_CONNECT.output, VALUE_TYPE.integer, 0);
|
||||
|
||||
static update = function(frame = ANIMATOR.current_frame) {
|
||||
if(!variable_struct_exists(group, "iterated")) return;
|
||||
var val = group.inputs[| 0].getValue();
|
||||
outputs[| 0].setValue(val);
|
||||
}
|
||||
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s) {
|
||||
var bbox = drawGetBbox(xx, yy, _s);
|
||||
draw_sprite_fit(s_node_iterator_length, 0, bbox.xc, bbox.yc, bbox.w, bbox.h);
|
||||
}
|
||||
}
|
11
scripts/node_iterator_length/node_iterator_length.yy
Normal file
11
scripts/node_iterator_length/node_iterator_length.yy
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"resourceType": "GMScript",
|
||||
"resourceVersion": "1.0",
|
||||
"name": "node_iterator_length",
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "for",
|
||||
"path": "folders/nodes/data/iterate/for.yy",
|
||||
},
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
|
||||
function Node_Iterator_Output(_x, _y, _group = -1) : Node_Group_Output(_x, _y, _group) constructor {
|
||||
name = "Output";
|
||||
name = "Loop Output";
|
||||
color = COLORS.node_blend_loop;
|
||||
|
||||
w = 96;
|
||||
|
@ -49,6 +48,7 @@ function Node_Iterator_Output(_x, _y, _group = -1) : Node_Group_Output(_x, _y, _
|
|||
var _ot = outParent;
|
||||
for(var j = 0; j < ds_list_size(_ot.value_to); j++) {
|
||||
var _to = _ot.value_to[| j];
|
||||
if(!_to.node.renderActive) continue;
|
||||
|
||||
if(_to.node.active && _to.value_from != noone && _to.value_from.node == group) {
|
||||
_to.node.triggerRender();
|
||||
|
|
|
@ -286,7 +286,7 @@ function valueAnimator(_val, _prop) constructor {
|
|||
if(typeArray(prop.display_type) && is_array(val)) {
|
||||
var __v = ds_list_create();
|
||||
for(var j = 0; j < array_length(val); j++) {
|
||||
if(is_struct(val[j]))
|
||||
if(is_struct(val[j]) && struct_has(val[j], "serialize"))
|
||||
ds_list_add_map(__v, val[j].serialize());
|
||||
else
|
||||
ds_list_add(__v, val[j]);
|
||||
|
|
|
@ -36,10 +36,15 @@ function Node_Line(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constru
|
|||
|
||||
inputs[| 12] = nodeValue("Span width over path", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false, "Apply the full 'width over length' to the trimmed path.");
|
||||
|
||||
inputs[| 13] = nodeValue("Round cap", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false);
|
||||
|
||||
inputs[| 14] = nodeValue("Round segment", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 4)
|
||||
.setDisplay(VALUE_DISPLAY.slider, [2, 16, 1]);
|
||||
|
||||
input_display_list = [
|
||||
["Output", true], 0, 1,
|
||||
["Line data", false], 6, 7, 2,
|
||||
["Line settings", false], 3, 11, 12, 8, 9,
|
||||
["Line settings", false], 3, 11, 12, 8, 9, 13, 14,
|
||||
["Wiggle", false], 4, 5,
|
||||
["Render", false], 10
|
||||
];
|
||||
|
@ -63,8 +68,17 @@ function Node_Line(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constru
|
|||
var _widc = _data[11];
|
||||
var _widap = _data[12];
|
||||
|
||||
var _rtStr = min(_ratio[0], _ratio[1]);
|
||||
var _rtLen = max(_ratio[0], _ratio[1]) - _rtStr;
|
||||
var _cap = _data[13];
|
||||
var _capP = _data[14];
|
||||
|
||||
inputs[| 14].setVisible(_cap);
|
||||
|
||||
var _rangeMin = min(_ratio[0], _ratio[1]);
|
||||
var _rangeMax = max(_ratio[0], _ratio[1]);
|
||||
if(_rangeMax == 1) _rangeMax = 0.99999;
|
||||
|
||||
var _rtStr = _rangeMin;
|
||||
var _rtLen = _rangeMax - _rangeMin;
|
||||
|
||||
var _use_path = _pat != noone && struct_has(_pat, "getPointRatio");
|
||||
if(_ang < 0) _ang = 360 + _ang;
|
||||
|
@ -80,20 +94,25 @@ function Node_Line(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constru
|
|||
if(_bg) draw_clear_alpha(0, 1);
|
||||
else draw_clear_alpha(0, 0);
|
||||
|
||||
var _ox, _nx, _oy, _ny, _ow, _nw, _oa, _na;
|
||||
var _ox, _nx, _oy, _ny, _ow, _nw, _oa, _na, _oc, _nc;
|
||||
|
||||
if(_use_path) {
|
||||
var ww = _rtLen / _seg;
|
||||
|
||||
var _total = _rtLen;
|
||||
var _prog_curr = frac(_shift + _rtStr) - ww;
|
||||
var _prog = _prog_curr + 1;
|
||||
var _prog_eli = 0;
|
||||
var _total = _rtLen;
|
||||
var _total_prev = _total;
|
||||
var _freeze = 0;
|
||||
var _prog_curr = frac(_shift + _rtStr) - ww;
|
||||
var _prog = _prog_curr + 1;
|
||||
var _prog_eli = 0;
|
||||
var step = 0;
|
||||
|
||||
while(_total > 0) {
|
||||
if(_prog_curr >= 1) _prog_curr = 0;
|
||||
else _prog_curr = min(_prog_curr + min(_total, ww), 1);
|
||||
_prog_eli += min(_total, ww);
|
||||
if(_prog_curr >= 1)
|
||||
_prog_curr = frac(_prog_curr);
|
||||
else
|
||||
_prog_curr = min(_prog_curr + min(_total, ww), 1);
|
||||
_prog_eli = _prog_eli + min(_total, ww);
|
||||
|
||||
var p = _pat.getPointRatio(_prog_curr);
|
||||
_nx = p[0];
|
||||
|
@ -109,26 +128,32 @@ function Node_Line(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constru
|
|||
}
|
||||
|
||||
_nw = random_range(_wid[0], _wid[1]);
|
||||
_nw *= eval_curve_x(_widc, _widap? _prog_curr / _rtLen : _prog_curr);
|
||||
_nw *= eval_curve_x(_widc, _widap? _prog_eli / _rtLen : _prog_curr);
|
||||
|
||||
if(_total <= _prog_curr - _prog) {
|
||||
_na = point_direction(_ox, _oy, _nx, _ny) + 90;
|
||||
} else {
|
||||
var np = _pat.getPointRatio(_prog_curr + ww);
|
||||
var _nna = point_direction(_nx, _ny, np[0], np[1]) + 90;
|
||||
|
||||
if(_total == _rtLen)
|
||||
_na = _nna;
|
||||
else {
|
||||
var _da = point_direction(_ox, _oy, _nx, _ny) + 90;
|
||||
_na = _da + angle_difference(_nna, _da) / 2;
|
||||
}
|
||||
var n0 = _pat.getPointRatio(_prog_curr - 0.001);
|
||||
var n1 = _pat.getPointRatio(_prog_curr + 0.001);
|
||||
_na = point_direction(n0[0], n0[1], n1[0], n1[1]) + 90;
|
||||
}
|
||||
|
||||
_nc = gradient_eval(_color, _prog_eli / _rtLen, ds_list_get(_col_data, 0));
|
||||
|
||||
if(_prog_curr > _prog) {
|
||||
draw_set_color(gradient_eval(_color, _prog_eli / _rtLen, ds_list_get(_col_data, 0)));
|
||||
draw_line_width2_angle(_ox, _oy, _nx, _ny, _ow, _nw, _oa, _na);
|
||||
_total -= (_prog_curr - _prog);
|
||||
if(_cap) {
|
||||
if(_total == _rtLen) {
|
||||
draw_set_color(_oc);
|
||||
draw_circle_angle(_ox, _oy, _ow / 2, _oa, _oa + 180, _capP);
|
||||
}
|
||||
if(_total - (_prog_curr - _prog) <= 0) {
|
||||
draw_set_color(_nc);
|
||||
draw_circle_angle(_nx, _ny, _nw / 2, _na - 180, _na, _capP);
|
||||
}
|
||||
}
|
||||
|
||||
draw_line_width2_angle(_ox, _oy, _nx, _ny, _ow, _nw, _oa, _na, _oc, _nc);
|
||||
_total -= _prog_curr - _prog;
|
||||
}
|
||||
|
||||
_prog = _prog_curr;
|
||||
|
@ -136,6 +161,10 @@ function Node_Line(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constru
|
|||
_ox = _nx;
|
||||
_oy = _ny;
|
||||
_ow = _nw;
|
||||
_oc = _nc;
|
||||
|
||||
if(_total_prev == _total && ++_freeze > 16) break;
|
||||
_total_prev = _total;
|
||||
}
|
||||
} else {
|
||||
var x0, y0, x1, y1;
|
||||
|
@ -150,10 +179,10 @@ function Node_Line(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constru
|
|||
var _d = point_direction(x0, y0, x1, y1);
|
||||
|
||||
var ww = _rtLen / _seg;
|
||||
var _total = _rtLen;
|
||||
var _prog_curr = frac(_shift + _rtStr) - ww;
|
||||
var _prog = _prog_curr + 1;
|
||||
var _prog_eli = 0;
|
||||
var _total = _rtLen;
|
||||
var _prog_curr = frac(_shift + _rtStr) - ww;
|
||||
var _prog = _prog_curr + 1;
|
||||
var _prog_eli = 0;
|
||||
|
||||
while(_total > 0) {
|
||||
if(_prog_curr >= 1) _prog_curr = 0;
|
||||
|
@ -170,11 +199,23 @@ function Node_Line(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constru
|
|||
_sedIndex++;
|
||||
|
||||
_nw = random_range(_wid[0], _wid[1]);
|
||||
_nw *= eval_curve_x(_widc, _prog_curr);
|
||||
_nw *= eval_curve_x(_widc, _widap? _prog_eli / _rtLen : _prog_curr);
|
||||
|
||||
_nc = gradient_eval(_color, _prog_eli / _rtLen, ds_list_get(_col_data, 0));
|
||||
|
||||
if(_prog_curr > _prog) {
|
||||
draw_set_color(gradient_eval(_color, _prog_eli / _rtLen, ds_list_get(_col_data, 0)));
|
||||
draw_line_width2_angle(_ox, _oy, _nx, _ny, _ow, _nw, _d + 90, _d + 90);
|
||||
if(_cap) {
|
||||
if(_total == _rtLen){
|
||||
draw_set_color(_oc);
|
||||
draw_circle_angle(_ox, _oy, _ow / 2, _d + 180 - 90, _d + 180 + 90, _capP);
|
||||
}
|
||||
if(_total - (_prog_curr - _prog) <= 0){
|
||||
draw_set_color(_nc);
|
||||
draw_circle_angle(_nx, _ny, _nw / 2, _d - 90, _d + 90, _capP);
|
||||
}
|
||||
}
|
||||
|
||||
draw_line_width2_angle(_ox, _oy, _nx, _ny, _ow, _nw, _d + 90, _d + 90, _oc, _nc);
|
||||
_total -= (_prog_curr - _prog);
|
||||
}
|
||||
|
||||
|
@ -182,6 +223,7 @@ function Node_Line(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constru
|
|||
_ox = _nx;
|
||||
_oy = _ny;
|
||||
_ow = _nw;
|
||||
_oc = _nc;
|
||||
}
|
||||
}
|
||||
surface_reset_target();
|
||||
|
|
|
@ -6,7 +6,8 @@ function Node_Lua_Compute(_x, _y, _group = -1) : Node(_x, _y, _group) constructo
|
|||
|
||||
inputs[| 1] = nodeValue("Return type", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Number", "String" ]);
|
||||
|
||||
inputs[| 1].editWidget.update_hover = false;
|
||||
|
||||
inputs[| 2] = nodeValue("Lua code", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, "", o_dialog_lua_reference)
|
||||
.setDisplay(VALUE_DISPLAY.code);
|
||||
|
||||
|
@ -20,6 +21,7 @@ function Node_Lua_Compute(_x, _y, _group = -1) : Node(_x, _y, _group) constructo
|
|||
inputs[| index + 1] = nodeValue("Argument type", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0 )
|
||||
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Number", "String", "Surface" ]);
|
||||
inputs[| index + 1].editWidget.interactable = false;
|
||||
inputs[| index + 1].editWidget.update_hover = false;
|
||||
|
||||
inputs[| index + 2] = nodeValue("Argument value", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0 )
|
||||
.setVisible(true, true);
|
||||
|
|
|
@ -20,6 +20,7 @@ function Node_Lua_Surface(_x, _y, _group = -1) : Node(_x, _y, _group) constructo
|
|||
inputs[| index + 1] = nodeValue("Argument type", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0 )
|
||||
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Number", "String", "Surface" ]);
|
||||
inputs[| index + 1].editWidget.interactable = false;
|
||||
inputs[| index + 1].editWidget.update_hover = false;
|
||||
|
||||
inputs[| index + 2] = nodeValue("Argument value", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0 )
|
||||
.setVisible(true, true);
|
||||
|
|
|
@ -24,7 +24,7 @@ function Node_Grid_Noise(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) c
|
|||
inputs[| 3] = nodeValue("Seed", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0);
|
||||
|
||||
inputs[| 4] = nodeValue("Shift", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
|
||||
.setDisplay(VALUE_DISPLAY.slider, [-2, 2, 0.01]);
|
||||
.setDisplay(VALUE_DISPLAY.slider, [-0.5, 0.5, 0.01]);
|
||||
|
||||
inputs[| 5] = nodeValue("Texture sample", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
|
||||
|
|
|
@ -32,18 +32,12 @@ function Node_Particle(_x, _y, _group = -1) : Node_VFX_Spawner_Base(_x, _y, _gro
|
|||
static onStep = function() {
|
||||
if(!ANIMATOR.frame_progress) return;
|
||||
|
||||
if(recoverCache()) {
|
||||
triggerRender();
|
||||
return;
|
||||
}
|
||||
|
||||
RETURN_ON_REST
|
||||
|
||||
if(ANIMATOR.current_frame == 0) {
|
||||
if(ANIMATOR.current_frame == 0)
|
||||
reset();
|
||||
runVFX(ANIMATOR.current_frame);
|
||||
} else if(cached_output[ANIMATOR.current_frame - 1] != 0)
|
||||
runVFX(ANIMATOR.current_frame);
|
||||
|
||||
runVFX(ANIMATOR.current_frame);
|
||||
}
|
||||
|
||||
function render(_time = ANIMATOR.current_frame) {
|
||||
|
@ -67,9 +61,8 @@ function Node_Particle(_x, _y, _group = -1) : Node_VFX_Spawner_Base(_x, _y, _gro
|
|||
var surf_w = surface_get_width(_outSurf);
|
||||
var surf_h = surface_get_height(_outSurf);
|
||||
|
||||
for(var i = 0; i < PREF_MAP[? "part_max_amount"]; i++) {
|
||||
for(var i = 0; i < PREF_MAP[? "part_max_amount"]; i++)
|
||||
parts[i].draw(_exact, surf_w, surf_h);
|
||||
}
|
||||
|
||||
BLEND_NORMAL;
|
||||
surface_reset_target();
|
||||
|
|
|
@ -44,6 +44,7 @@ function Node_Path(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
[ "Circle path", THEME.path_tools_circle ],
|
||||
];
|
||||
|
||||
anchors = [];
|
||||
lengths = [];
|
||||
length_total = 0;
|
||||
|
||||
|
@ -404,6 +405,7 @@ function Node_Path(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
var ansize = ds_list_size(inputs) - input_fix_len;
|
||||
if(ansize < 2) {
|
||||
lengths = [];
|
||||
anchors = [];
|
||||
return;
|
||||
}
|
||||
var sample = PREF_MAP[? "path_resolution"];
|
||||
|
@ -411,6 +413,7 @@ function Node_Path(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
var con = loop? ansize : ansize - 1;
|
||||
if(array_length(lengths) != con)
|
||||
array_resize(lengths, con);
|
||||
array_resize(anchors, ansize);
|
||||
|
||||
for(var i = 0; i < con; i++) {
|
||||
var index_0 = input_fix_len + i;
|
||||
|
@ -419,6 +422,8 @@ function Node_Path(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
|
||||
var _a0 = inputs[| index_0].getValue();
|
||||
var _a1 = inputs[| index_1].getValue();
|
||||
anchors[i] = _a0;
|
||||
anchors[i + 1] = _a1;
|
||||
|
||||
var l = 0;
|
||||
|
||||
|
@ -483,17 +488,19 @@ function Node_Path(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
var _a0, _a1;
|
||||
|
||||
for(var i = 0; i < ansize; i++) {
|
||||
_a0 = inputs[| input_fix_len + i].getValue();
|
||||
_a1 = inputs[| input_fix_len + safe_mod(i + 1, amo)].getValue();
|
||||
_a0 = anchors[i];
|
||||
_a1 = anchors[safe_mod(i + 1, amo)];
|
||||
|
||||
if(pix <= lengths[i]) {
|
||||
var _t = pix / lengths[i];
|
||||
|
||||
if(!is_array(_a0) || !is_array(_a1))
|
||||
return [0, 0];
|
||||
return eval_bezier(_t, _a0[0], _a0[1], _a1[0], _a1[1], _a0[0] + _a0[4], _a0[1] + _a0[5], _a1[0] + _a1[2], _a1[1] + _a1[3]);
|
||||
if(pix > lengths[i]) {
|
||||
pix -= lengths[i];
|
||||
continue;
|
||||
}
|
||||
pix -= lengths[i];
|
||||
|
||||
var _t = pix / lengths[i];
|
||||
|
||||
if(!is_array(_a0) || !is_array(_a1))
|
||||
return [0, 0];
|
||||
return eval_bezier(_t, _a0[0], _a0[1], _a1[0], _a1[1], _a0[0] + _a0[4], _a0[1] + _a0[5], _a1[0] + _a1[2], _a1[1] + _a1[3]);
|
||||
}
|
||||
|
||||
return [0, 0];
|
||||
|
|
12
scripts/node_polygonal_shape/node_gradient.yy
Normal file
12
scripts/node_polygonal_shape/node_gradient.yy
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "generator",
|
||||
"path": "folders/nodes/data/generator.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "node_gradient",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
12
scripts/node_polygonal_shape/node_perlin.yy
Normal file
12
scripts/node_polygonal_shape/node_perlin.yy
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "generator",
|
||||
"path": "folders/nodes/data/generator.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "node_perlin",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
162
scripts/node_polygonal_shape/node_polygonal_shape.gml
Normal file
162
scripts/node_polygonal_shape/node_polygonal_shape.gml
Normal file
|
@ -0,0 +1,162 @@
|
|||
function Node_Shape_Polygon(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Polygon Shape";
|
||||
|
||||
shapesArray = [ "Rectangle", "Ellipse", "Star", "Capsule", "Ring", "Arc", "Gear", "Cross" ];
|
||||
|
||||
inputs[| 0] = nodeValue("Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, def_surf_size2 )
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 1] = nodeValue("Backgroud", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false);
|
||||
|
||||
inputs[| 2] = nodeValue("Backgroud color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_black);
|
||||
|
||||
inputs[| 3] = nodeValue("Shape color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_white);
|
||||
|
||||
inputs[| 4] = nodeValue("Shape", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
.setDisplay(VALUE_DISPLAY.enum_scroll, shapesArray);
|
||||
|
||||
inputs[| 5] = nodeValue("Position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0.5, 0.5 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector)
|
||||
.setUnitRef(function(index) { return getDimension(index); }, VALUE_UNIT.reference);
|
||||
|
||||
inputs[| 6] = nodeValue("Rotation", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
|
||||
.setDisplay(VALUE_DISPLAY.rotation);
|
||||
|
||||
inputs[| 7] = nodeValue("Scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [ 0.5, 0.5 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector)
|
||||
.setUnitRef(function(index) { return getDimension(index); }, VALUE_UNIT.reference);
|
||||
|
||||
inputs[| 8] = nodeValue("Sides", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 32)
|
||||
.setDisplay(VALUE_DISPLAY.slider, [2, 64, 1]);
|
||||
|
||||
inputs[| 9] = nodeValue("Inner radius", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.5)
|
||||
.setDisplay(VALUE_DISPLAY.slider, [0, 1, 0.01]);
|
||||
|
||||
inputs[| 10] = nodeValue("Radius", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.5)
|
||||
.setDisplay(VALUE_DISPLAY.slider, [0, 1, 0.01]);
|
||||
|
||||
inputs[| 11] = nodeValue("Teeth", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 6)
|
||||
.setDisplay(VALUE_DISPLAY.slider, [3, 16, 1]);
|
||||
|
||||
inputs[| 12] = nodeValue("Teeth height", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.2)
|
||||
.setDisplay(VALUE_DISPLAY.slider, [0, 1, 0.01]);
|
||||
|
||||
inputs[| 13] = nodeValue("Teeth taper", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
|
||||
.setDisplay(VALUE_DISPLAY.slider, [-0.5, 0.5, 0.01]);
|
||||
|
||||
inputs[| 14] = nodeValue("Angle range", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 360 ])
|
||||
.setDisplay(VALUE_DISPLAY.rotation_range);
|
||||
|
||||
inputs[| 15] = nodeValue("Round cap", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false);
|
||||
|
||||
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
||||
|
||||
input_display_list = [
|
||||
["Surface", false], 0,
|
||||
["Transform", false], 5, 6, 7,
|
||||
["Shape", false], 4, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
["Render", true], 1, 2, 3,
|
||||
];
|
||||
|
||||
node_draw_transform_init();
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
if(array_length(current_data) != ds_list_size(inputs)) return;
|
||||
if(process_amount > 1) return;
|
||||
|
||||
node_draw_transform_box(active, _x, _y, _s, _mx, _my, _snx, _sny, 5, 6, 7);
|
||||
}
|
||||
|
||||
static draw_vertex_transform = function(_x, _y, _pos, _rot) {
|
||||
var p = point_rotate(_x, _y, 0, 0, _rot);
|
||||
draw_vertex(p[0] + _pos[0], p[1] + _pos[1]);
|
||||
}
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var _dim = _data[0];
|
||||
var _bg = _data[1];
|
||||
var _bgc = _data[2];
|
||||
var _shc = _data[3];
|
||||
var _shp = _data[4];
|
||||
var _pos = _data[5];
|
||||
var _rot = _data[6];
|
||||
var _sca = _data[7];
|
||||
var _side = _data[8];
|
||||
var _inner = _data[9];
|
||||
var _rad = _data[10];
|
||||
var _teeth = _data[11];
|
||||
var _thHei = _data[12];
|
||||
var _thTap = _data[13];
|
||||
var _aRan = _data[14];
|
||||
var _cap = _data[15];
|
||||
|
||||
inputs[| 8].setVisible(_shp == 1 || _shp == 2 || _shp == 3 || _shp == 4 || _shp == 5);
|
||||
inputs[| 9].setVisible(_shp == 2 || _shp == 4 || _shp == 5 || _shp == 6 || _shp == 7);
|
||||
inputs[| 10].setVisible(_shp == 3);
|
||||
inputs[| 11].setVisible(_shp == 6);
|
||||
inputs[| 12].setVisible(_shp == 6);
|
||||
inputs[| 13].setVisible(_shp == 6);
|
||||
inputs[| 14].setVisible(_shp == 5);
|
||||
inputs[| 15].setVisible(_shp == 5);
|
||||
|
||||
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1]);
|
||||
|
||||
var data = {
|
||||
side: _side,
|
||||
inner: _inner,
|
||||
radius: _rad,
|
||||
radRan: _aRan,
|
||||
teeth: _teeth,
|
||||
teethH: _thHei,
|
||||
teethT: _thTap,
|
||||
cap: _cap,
|
||||
};
|
||||
|
||||
surface_set_target(_outSurf);
|
||||
if(_bg) draw_clear_alpha(_bgc, 1);
|
||||
else draw_clear_alpha(0, 0);
|
||||
|
||||
draw_set_color(_shc);
|
||||
draw_primitive_begin(pr_trianglelist);
|
||||
var points = [];
|
||||
|
||||
switch(array_safe_get(shapesArray, _shp)) {
|
||||
case "Rectangle" : points = SHAPE_rectangle(_sca); break;
|
||||
case "Ellipse" : points = SHAPE_circle(_sca, data); break;
|
||||
case "Star" : points = SHAPE_star(_sca, data); break;
|
||||
case "Capsule" : points = SHAPE_capsule(_sca, data); break;
|
||||
case "Ring" : points = SHAPE_ring(_sca, data); break;
|
||||
case "Arc" : points = SHAPE_arc(_sca, data); break;
|
||||
case "Gear" : points = SHAPE_gear(_sca, data); break;
|
||||
case "Cross" : points = SHAPE_cross(_sca, data); break;
|
||||
}
|
||||
|
||||
var shapes = [];
|
||||
for( var i = 0; i < array_length(points); i++ ) {
|
||||
if(points[i].type == SHAPE_TYPE.points)
|
||||
shapes[i] = polygon_triangulate(points[i].points);
|
||||
else if(points[i].type == SHAPE_TYPE.triangles)
|
||||
shapes[i] = points[i].triangles;
|
||||
}
|
||||
|
||||
for( var i = 0; i < array_length(shapes); i++ ) {
|
||||
var triangles = shapes[i];
|
||||
|
||||
for( var j = 0; j < array_length(triangles); j++ ) {
|
||||
var tri = triangles[j];
|
||||
var p0 = tri[0];
|
||||
var p1 = tri[1];
|
||||
var p2 = tri[2];
|
||||
|
||||
draw_vertex_transform(p0[0], p0[1], _pos, _rot);
|
||||
draw_vertex_transform(p1[0], p1[1], _pos, _rot);
|
||||
draw_vertex_transform(p2[0], p2[1], _pos, _rot);
|
||||
}
|
||||
}
|
||||
draw_primitive_end();
|
||||
|
||||
surface_reset_target();
|
||||
|
||||
return _outSurf;
|
||||
}
|
||||
}
|
11
scripts/node_polygonal_shape/node_polygonal_shape.yy
Normal file
11
scripts/node_polygonal_shape/node_polygonal_shape.yy
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"resourceType": "GMScript",
|
||||
"resourceVersion": "1.0",
|
||||
"name": "node_polygonal_shape",
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "generator",
|
||||
"path": "folders/nodes/data/generator.yy",
|
||||
},
|
||||
}
|
|
@ -67,7 +67,8 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor {
|
|||
addNodeObject(iter, "Output", s_node_loop_output, "Node_Iterator_Output", [1, Node_Iterator_Output]);
|
||||
|
||||
ds_list_add(iter, "Loops");
|
||||
addNodeObject(iter, "Index", s_node_iterator_index, "Node_Iterator_Index", [1, Node_Iterator_Index]);
|
||||
addNodeObject(iter, "Index", s_node_iterator_index, "Node_Iterator_Index", [1, Node_Iterator_Index]);
|
||||
addNodeObject(iter, "Loop amount", s_node_iterator_amount, "Node_Iterator_Length", [1, Node_Iterator_Length]);
|
||||
|
||||
var itere = ds_list_create();
|
||||
addNodeCatagory("Loop", itere, ["Node_Iterate_Each"]);
|
||||
|
@ -76,7 +77,8 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor {
|
|||
addNodeObject(itere, "Output", s_node_group_output, "Node_Group_Output", [1, Node_Group_Output]);
|
||||
|
||||
ds_list_add(itere, "Loops");
|
||||
addNodeObject(itere, "Index", s_node_iterator_index, "Node_Iterator_Index", [1, Node_Iterator_Index]);
|
||||
addNodeObject(itere, "Index", s_node_iterator_index, "Node_Iterator_Index", [1, Node_Iterator_Index]);
|
||||
addNodeObject(itere, "Array Length", s_node_iterator_length, "Node_Iterator_Each_Length", [1, Node_Iterator_Each_Length]);
|
||||
|
||||
var feed = ds_list_create();
|
||||
addNodeCatagory("Feedback", feed, ["Node_Feedback"]);
|
||||
|
@ -219,7 +221,7 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor {
|
|||
addNodeObject(filter, "Glow", s_node_glow, "Node_Glow", [1, Node_Glow]);
|
||||
addNodeObject(filter, "Shadow", s_node_shadow, "Node_Shadow", [1, Node_Shadow]);
|
||||
addNodeObject(filter, "Bloom", s_node_bloom, "Node_Bloom", [1, Node_Bloom]);
|
||||
//addNodeObject(filter, "Trail", s_node_trail, "Node_Trail", [1, Node_Trail]);
|
||||
addNodeObject(filter, "Trail", s_node_trail, "Node_Trail", [1, Node_Trail]);
|
||||
addNodeObject(filter, "Erode", s_node_erode, "Node_Erode", [1, Node_Erode]);
|
||||
addNodeObject(filter, "Corner", s_node_corner, "Node_Corner", [1, Node_Corner], ["round corner"]).set_version(1110);
|
||||
addNodeObject(filter, "2D Light", s_node_2d_light, "Node_2D_light", [1, Node_2D_light]);
|
||||
|
@ -289,9 +291,10 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor {
|
|||
addNodeObject(generator, "4 Points Gradient", s_node_gradient_4points, "Node_Gradient_Points", [1, Node_Gradient_Points]);
|
||||
|
||||
ds_list_add(generator, "Drawer");
|
||||
addNodeObject(generator, "Line", s_node_line, "Node_Line", [1, Node_Line]);
|
||||
addNodeObject(generator, "Draw Text", s_node_text_render, "Node_Text", [1, Node_Text]);
|
||||
addNodeObject(generator, "Shape", s_node_shape, "Node_Shape", [1, Node_Shape]);
|
||||
addNodeObject(generator, "Line", s_node_line, "Node_Line", [1, Node_Line]);
|
||||
addNodeObject(generator, "Draw Text", s_node_text_render, "Node_Text", [1, Node_Text]);
|
||||
addNodeObject(generator, "Shape", s_node_shape, "Node_Shape", [1, Node_Shape]);
|
||||
addNodeObject(generator, "Polygon Shape", s_node_shape, "Node_Shape_Polygon", [1, Node_Shape_Polygon]).set_version(1130);
|
||||
|
||||
ds_list_add(generator, "Noises");
|
||||
addNodeObject(generator, "Noise", s_node_noise, "Node_Noise", [1, Node_Noise]);
|
||||
|
@ -337,8 +340,9 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor {
|
|||
var renderNode = ds_list_create();
|
||||
addNodeCatagory("Render", renderNode);
|
||||
ds_list_add(renderNode, "Renders");
|
||||
addNodeObject(renderNode, "Render Spritesheet", s_node_sprite_sheet, "Node_Render_Sprite_Sheet", [1, Node_Render_Sprite_Sheet]);
|
||||
if(!DEMO) addNodeObject(renderNode, "Export", s_node_export, "Node_Export", [0, Node_create_Export]);
|
||||
addNodeObject(renderNode, "Render Spritesheet", s_node_sprite_sheet, "Node_Render_Sprite_Sheet", [1, Node_Render_Sprite_Sheet]);
|
||||
addNodeObject(renderNode, "Cache Array", s_node_cache_array, "Node_Cache_Array", [1, Node_Cache_Array]).set_version(1130);
|
||||
if(!DEMO) addNodeObject(renderNode, "Export", s_node_export, "Node_Export", [0, Node_create_Export]);
|
||||
//addNodeObject(renderNode, "Preview timeline", s_node_timeline_preview,"Node_Timeline_Preview", [1, Node_create_Timeline_Preview]);
|
||||
|
||||
var values = ds_list_create();
|
||||
|
|
|
@ -92,7 +92,7 @@ function Node_Stack(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
|
||||
surface_set_target(_outSurf);
|
||||
draw_clear_alpha(0, 0);
|
||||
//BLEND_OVERRIDE;
|
||||
BLEND_ALPHA;
|
||||
|
||||
var sx = 0, sy = 0;
|
||||
for( var i = input_fix_len; i < ds_list_size(inputs) - 1; i++ ) {
|
||||
|
|
|
@ -1,73 +1,71 @@
|
|||
function Node_Trail(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
function Node_Trail(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
||||
name = "Trail";
|
||||
use_cache = true;
|
||||
|
||||
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
inputs[| 1] = nodeValue("Max life", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 3);
|
||||
inputs[| 2] = nodeValue("Step", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 1);
|
||||
inputs[| 3] = nodeValue("Alpha decrease", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
|
||||
.setDisplay(VALUE_DISPLAY.slider, [0, 1, 0.01]);
|
||||
inputs[| 1] = nodeValue("Max life", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 5);
|
||||
inputs[| 2] = nodeValue("Alpha fade", self, JUNCTION_CONNECT.input, VALUE_TYPE.curve, CURVE_DEF_11);
|
||||
|
||||
inputs[| 4] = nodeValue("Blend mode", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
inputs[| 3] = nodeValue("Blend mode", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
.setDisplay(VALUE_DISPLAY.enum_scroll, BLEND_TYPES );
|
||||
|
||||
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
||||
|
||||
input_display_list = [
|
||||
["Trail settings", false], 0, 1, 2, 4, 3
|
||||
["Surface", true], 0,
|
||||
["Trail settings", false], 1, 3, 2
|
||||
];
|
||||
|
||||
temp_surf = [ surface_create(1, 1), surface_create(1, 1) ];
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||
if(!inputs[| 0].value_from)
|
||||
return _outSurf;
|
||||
if(array_length(cached_output) != ANIMATOR.frames_total + 1)
|
||||
return _outSurf
|
||||
static update = function() {
|
||||
if(!inputs[| 0].value_from) return;
|
||||
if(array_length(cached_output) != ANIMATOR.frames_total + 1) return;
|
||||
|
||||
var _surf = inputs[| 0].getValue();
|
||||
var _life = inputs[| 1].getValue();
|
||||
var _alpha = inputs[| 2].getValue();
|
||||
var _blend = inputs[| 3].getValue();
|
||||
|
||||
if(!is_surface(_surf)) return;
|
||||
cacheCurrentFrame(_surf);
|
||||
|
||||
for(var i = 0; i < 2; i++) {
|
||||
temp_surf[i] = surface_verify(temp_surf[i], surface_get_width(_outSurf), surface_get_height(_outSurf));
|
||||
temp_surf[i] = surface_verify(temp_surf[i], surface_get_width(_surf), surface_get_height(_surf));
|
||||
|
||||
surface_set_target(temp_surf[i]);
|
||||
draw_clear_alpha(0, 0);
|
||||
surface_reset_target();
|
||||
}
|
||||
|
||||
var _life = _data[1];
|
||||
var _step = _data[2];
|
||||
var _alpha = _data[3];
|
||||
var _blend = _data[4];
|
||||
var _outSurf = outputs[| 0].getValue();
|
||||
_outSurf = surface_verify(_outSurf, surface_get_width(_surf), surface_get_height(_surf));
|
||||
outputs[| 0].setValue(_outSurf);
|
||||
|
||||
var curf = ANIMATOR.current_frame;
|
||||
var aa = 1;
|
||||
var res_index = 0;
|
||||
var frame_amo = min(_life, floor(ANIMATOR.current_frame / _step));
|
||||
var st_frame = ANIMATOR.current_frame - frame_amo * _step;
|
||||
var frame_amo = min(_life, curf);
|
||||
var st_frame = curf - frame_amo;
|
||||
var bg = 0;
|
||||
|
||||
for(var i = 0; i <= _life; i++) {
|
||||
var frame_idx = clamp(st_frame + i * _step, 0, ANIMATOR.frames_total - 1);
|
||||
var bg = i % 2;
|
||||
var fg = !bg;
|
||||
var aa = 1 - _alpha * (_life - i);
|
||||
for(var i = 0; i <= frame_amo; i++) {
|
||||
var frame_idx = st_frame + i;
|
||||
var prog = (frame_idx - (curf - _life)) / _life;
|
||||
var aa = eval_curve_x(_alpha, prog);
|
||||
aa = power(aa, 2);
|
||||
|
||||
bg = !bg;
|
||||
|
||||
surface_set_target(temp_surf[bg]);
|
||||
if(i == _life)
|
||||
draw_surface_safe(_data[0], 0, 0);
|
||||
else if(is_surface(cached_output[frame_idx]))
|
||||
draw_surface_blend(temp_surf[fg], cached_output[frame_idx], _blend, aa);
|
||||
draw_surface_blend(temp_surf[!bg], getCacheFrame(frame_idx), _blend, aa, false);
|
||||
surface_reset_target();
|
||||
|
||||
res_index = bg;
|
||||
}
|
||||
|
||||
surface_set_target(_outSurf);
|
||||
draw_clear_alpha(0, 0);
|
||||
BLEND_OVERRIDE;
|
||||
draw_surface_safe(temp_surf[res_index], 0, 0);
|
||||
draw_surface_safe(temp_surf[bg], 0, 0);
|
||||
BLEND_NORMAL;
|
||||
surface_reset_target();
|
||||
|
||||
cacheCurrentFrame(_data[0]);
|
||||
|
||||
return _outSurf;
|
||||
}
|
||||
}
|
|
@ -55,7 +55,12 @@ function Panel_Collection() : PanelContent() constructor {
|
|||
refreshContext();
|
||||
})
|
||||
];
|
||||
} else if(STEAM_ENABLED) {
|
||||
|
||||
if(STEAM_ENABLED)
|
||||
array_push(contentMenu, -1);
|
||||
}
|
||||
|
||||
if(STEAM_ENABLED) {
|
||||
if(!meta.steam) {
|
||||
array_push(contentMenu, menuItem(get_text("panel_collection_workshop_upload", "Upload to Steam Workshop") + "...", function() {
|
||||
var dia = dialogCall(o_dialog_file_name_collection, mouse_mx + ui(8), mouse_my + ui(-320));
|
||||
|
|
|
@ -178,6 +178,7 @@ function Panel_Graph() : PanelContent() constructor {
|
|||
|
||||
addHotkey("Graph", "Toggle grid", "G", MOD_KEY.none, function() { show_grid = !show_grid; });
|
||||
addHotkey("Graph", "Toggle preview", "H", MOD_KEY.none, function() { setTriggerPreview(); });
|
||||
addHotkey("Graph", "Toggle render", "R", MOD_KEY.none, function() { setTriggerRender(); });
|
||||
|
||||
if(!DEMO)
|
||||
addHotkey("Graph", "Export", "E", MOD_KEY.ctrl, function() { setCurrentExport(); });
|
||||
|
@ -449,6 +450,10 @@ function Panel_Graph() : PanelContent() constructor {
|
|||
menuItem(get_text("panel_graph_toggle_preview", "Toggle node preview"), function() {
|
||||
setTriggerPreview();
|
||||
}, noone, ["Graph", "Toggle preview"]));
|
||||
array_push(menu,
|
||||
menuItem(get_text("panel_graph_toggle_render", "Toggle node render"), function() {
|
||||
setTriggerRender();
|
||||
}, noone, ["Graph", "Toggle render"]));
|
||||
|
||||
array_push(menu,
|
||||
menuItem(get_text("panel_graph_delete_and_merge_connection", "Delete and merge connection"), function() {
|
||||
|
@ -524,6 +529,7 @@ function Panel_Graph() : PanelContent() constructor {
|
|||
|
||||
for(var i = 0; i < ds_list_size(nodes_select_list); i++) {
|
||||
var _node = nodes_select_list[| i];
|
||||
if(!_node) continue;
|
||||
_node.drawActive(gr_x, gr_y, graph_s);
|
||||
}
|
||||
//print("Draw active: " + string(current_time - t)); t = current_time;
|
||||
|
@ -1030,6 +1036,17 @@ function Panel_Graph() : PanelContent() constructor {
|
|||
}
|
||||
}
|
||||
|
||||
function setTriggerRender() {
|
||||
if(node_focus != noone)
|
||||
node_focus.renderActive = !node_focus.renderActive;
|
||||
|
||||
var show = false;
|
||||
for(var i = 0; i < ds_list_size(nodes_select_list); i++) {
|
||||
if(i == 0) show = !nodes_select_list[| i].renderActive;
|
||||
nodes_select_list[| i].renderActive = show;
|
||||
}
|
||||
}
|
||||
|
||||
function setCurrentCanvasBlend(_node = node_focus) {
|
||||
if(!_node) return;
|
||||
|
||||
|
|
|
@ -4,13 +4,14 @@ enum RENDER_TYPE {
|
|||
full = 2
|
||||
}
|
||||
|
||||
global.RENDER_LOG = true;
|
||||
global.RENDER_LOG = false;
|
||||
global.group_inputs = [ "Node_Group_Input", "Node_Feedback_Input", "Node_Iterator_Input", "Node_Iterator_Each_Input" ];
|
||||
|
||||
function __nodeLeafList(_list, _queue) {
|
||||
for( var i = 0; i < ds_list_size(_list); i++ ) {
|
||||
var _node = _list[| i];
|
||||
if(!_node.active) continue;
|
||||
if(!_node.renderActive) continue;
|
||||
|
||||
var _startNode = _node.isRenderable(true);
|
||||
if(_startNode) {
|
||||
|
@ -70,6 +71,7 @@ function Render(partial = false) {
|
|||
if(array_exists(global.group_inputs, instanceof(_node))) continue;
|
||||
|
||||
if(!_node.active) continue;
|
||||
if(!_node.renderActive) continue;
|
||||
if(_node.rendered) continue;
|
||||
if(__nodeInLoop(_node)) continue;
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ function scrollBox(_data, _onModify) : widget() constructor {
|
|||
|
||||
align = fa_center;
|
||||
extra_button = noone;
|
||||
update_hover = true;
|
||||
|
||||
static trigger = function() {
|
||||
if(is_method(data_list)) data = data_list();
|
||||
|
@ -23,6 +24,7 @@ function scrollBox(_data, _onModify) : widget() constructor {
|
|||
initVal = ind;
|
||||
dialog_w = other.w;
|
||||
align = other.align;
|
||||
update_hover = other.update_hover;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -121,10 +121,7 @@ function surface_copy_from(dst, src) {
|
|||
function surface_clone(surface, source = noone) {
|
||||
if(!is_surface(surface)) return noone;
|
||||
|
||||
if(source == noone)
|
||||
source = surface_create_valid(surface_get_width(surface), surface_get_height(surface));
|
||||
else
|
||||
source = surface_verify(source, surface_get_width(surface), surface_get_height(surface));
|
||||
source = surface_verify(source, surface_get_width(surface), surface_get_height(surface));
|
||||
|
||||
surface_set_target(source);
|
||||
draw_clear_alpha(0, 0);
|
||||
|
|
11
shaders/sh_blend_replace/sh_blend_add.yy
Normal file
11
shaders/sh_blend_replace/sh_blend_add.yy
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"type": 1,
|
||||
"parent": {
|
||||
"name": "blend",
|
||||
"path": "folders/shader/blend.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "sh_blend_add",
|
||||
"tags": [],
|
||||
"resourceType": "GMShader",
|
||||
}
|
11
shaders/sh_blend_replace/sh_blend_add_alpha_adj.yy
Normal file
11
shaders/sh_blend_replace/sh_blend_add_alpha_adj.yy
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"type": 1,
|
||||
"parent": {
|
||||
"name": "blend",
|
||||
"path": "folders/shader/blend.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "sh_blend_add_alpha_adj",
|
||||
"tags": [],
|
||||
"resourceType": "GMShader",
|
||||
}
|
11
shaders/sh_blend_replace/sh_blend_max.yy
Normal file
11
shaders/sh_blend_replace/sh_blend_max.yy
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"type": 1,
|
||||
"parent": {
|
||||
"name": "blend",
|
||||
"path": "folders/shader/blend.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "sh_blend_max",
|
||||
"tags": [],
|
||||
"resourceType": "GMShader",
|
||||
}
|
11
shaders/sh_blend_replace/sh_blend_multiply.yy
Normal file
11
shaders/sh_blend_replace/sh_blend_multiply.yy
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"type": 1,
|
||||
"parent": {
|
||||
"name": "shader",
|
||||
"path": "folders/shader.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "sh_blend_multiply",
|
||||
"tags": [],
|
||||
"resourceType": "GMShader",
|
||||
}
|
11
shaders/sh_blend_replace/sh_blend_normal.yy
Normal file
11
shaders/sh_blend_replace/sh_blend_normal.yy
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"type": 1,
|
||||
"parent": {
|
||||
"name": "blend",
|
||||
"path": "folders/shader/blend.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "sh_blend_normal",
|
||||
"tags": [],
|
||||
"resourceType": "GMShader",
|
||||
}
|
34
shaders/sh_blend_replace/sh_blend_replace.fsh
Normal file
34
shaders/sh_blend_replace/sh_blend_replace.fsh
Normal file
|
@ -0,0 +1,34 @@
|
|||
//
|
||||
// Simple passthrough fragment shader
|
||||
//
|
||||
varying vec2 v_vTexcoord;
|
||||
varying vec4 v_vColour;
|
||||
|
||||
uniform vec2 dimension;
|
||||
uniform int tile_type;
|
||||
|
||||
uniform int useMask;
|
||||
uniform int preserveAlpha;
|
||||
uniform sampler2D mask;
|
||||
uniform sampler2D fore;
|
||||
uniform float opacity;
|
||||
|
||||
float sampleMask() {
|
||||
if(useMask == 0) return 1.;
|
||||
vec4 m = texture2D( mask, v_vTexcoord );
|
||||
return (m.r + m.g + m.b) / 3. * m.a;
|
||||
}
|
||||
|
||||
void main() {
|
||||
vec4 _col0 = texture2D( gm_BaseTexture, v_vTexcoord );
|
||||
|
||||
vec2 fore_tex = v_vTexcoord;
|
||||
if(tile_type == 0) {
|
||||
fore_tex = v_vTexcoord;
|
||||
} else if(tile_type == 1) {
|
||||
fore_tex = fract(v_vTexcoord * dimension);
|
||||
}
|
||||
|
||||
vec4 _col1 = texture2D( fore, fore_tex );
|
||||
gl_FragColor = mix(_col0, _col1, opacity * sampleMask());
|
||||
}
|
19
shaders/sh_blend_replace/sh_blend_replace.vsh
Normal file
19
shaders/sh_blend_replace/sh_blend_replace.vsh
Normal file
|
@ -0,0 +1,19 @@
|
|||
//
|
||||
// Simple passthrough vertex shader
|
||||
//
|
||||
attribute vec3 in_Position; // (x,y,z)
|
||||
//attribute vec3 in_Normal; // (x,y,z) unused in this shader.
|
||||
attribute vec4 in_Colour; // (r,g,b,a)
|
||||
attribute vec2 in_TextureCoord; // (u,v)
|
||||
|
||||
varying vec2 v_vTexcoord;
|
||||
varying vec4 v_vColour;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 object_space_pos = vec4( in_Position.x, in_Position.y, in_Position.z, 1.0);
|
||||
gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * object_space_pos;
|
||||
|
||||
v_vColour = in_Colour;
|
||||
v_vTexcoord = in_TextureCoord;
|
||||
}
|
10
shaders/sh_blend_replace/sh_blend_replace.yy
Normal file
10
shaders/sh_blend_replace/sh_blend_replace.yy
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"resourceType": "GMShader",
|
||||
"resourceVersion": "1.0",
|
||||
"name": "sh_blend_replace",
|
||||
"type": 1,
|
||||
"parent": {
|
||||
"name": "blend",
|
||||
"path": "folders/shader/blend.yy",
|
||||
},
|
||||
}
|
|
@ -25,10 +25,15 @@ void main() {
|
|||
vec2 st = v_vTexcoord - position / dimension;
|
||||
vec2 pos = vec2(st * scale);
|
||||
|
||||
if(shiftAxis == 0)
|
||||
pos.x += random(vec2(0., floor(pos.y))) * shift;
|
||||
else if(shiftAxis == 1)
|
||||
pos.y += random(vec2(0., floor(pos.x))) * shift;
|
||||
if(shiftAxis == 0) {
|
||||
//pos.x += random(vec2(0., floor(pos.y)));
|
||||
if(mod(pos.y, 2.) > 1.)
|
||||
pos.x += shift;
|
||||
} else if(shiftAxis == 1) {
|
||||
//pos.y += random(vec2(0., floor(pos.x)));
|
||||
if(mod(pos.x, 2.) > 1.)
|
||||
pos.y += shift;
|
||||
}
|
||||
|
||||
if(useSampler == 0) {
|
||||
vec2 i = floor(pos);
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 966 B |
Binary file not shown.
After Width: | Height: | Size: 966 B |
74
sprites/s_node_cache_array/s_node_cache_array.yy
Normal file
74
sprites/s_node_cache_array/s_node_cache_array.yy
Normal file
|
@ -0,0 +1,74 @@
|
|||
{
|
||||
"resourceType": "GMSprite",
|
||||
"resourceVersion": "1.0",
|
||||
"name": "s_node_cache_array",
|
||||
"bboxMode": 0,
|
||||
"collisionKind": 1,
|
||||
"type": 0,
|
||||
"origin": 4,
|
||||
"preMultiplyAlpha": false,
|
||||
"edgeFiltering": false,
|
||||
"collisionTolerance": 0,
|
||||
"swfPrecision": 2.525,
|
||||
"bbox_left": 0,
|
||||
"bbox_right": 63,
|
||||
"bbox_top": 14,
|
||||
"bbox_bottom": 49,
|
||||
"HTile": false,
|
||||
"VTile": false,
|
||||
"For3D": false,
|
||||
"DynamicTexturePage": false,
|
||||
"width": 64,
|
||||
"height": 64,
|
||||
"textureGroupId": {
|
||||
"name": "Default",
|
||||
"path": "texturegroups/Default",
|
||||
},
|
||||
"swatchColours": null,
|
||||
"gridX": 0,
|
||||
"gridY": 0,
|
||||
"frames": [
|
||||
{"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"32d30ea4-f058-42d5-be58-facfee2d02e8",},
|
||||
],
|
||||
"sequence": {
|
||||
"resourceType": "GMSequence",
|
||||
"resourceVersion": "1.4",
|
||||
"name": "s_node_cache_array",
|
||||
"timeUnits": 1,
|
||||
"playback": 1,
|
||||
"playbackSpeed": 30.0,
|
||||
"playbackSpeedType": 0,
|
||||
"autoRecord": true,
|
||||
"volume": 1.0,
|
||||
"length": 1.0,
|
||||
"events": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore<MessageEventKeyframe>",},
|
||||
"moments": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore<MomentsEventKeyframe>",},
|
||||
"tracks": [
|
||||
{"resourceType":"GMSpriteFramesTrack","resourceVersion":"1.0","name":"frames","spriteId":null,"keyframes":{"Keyframes":[
|
||||
{"id":"fa4b839f-08f2-435c-beae-3fa1270286ce","Key":0.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"32d30ea4-f058-42d5-be58-facfee2d02e8","path":"sprites/s_node_cache_array/s_node_cache_array.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe<SpriteFrameKeyframe>",},
|
||||
],"resourceVersion":"1.0","resourceType":"KeyframeStore<SpriteFrameKeyframe>",},"trackColour":0,"inheritsTrackColour":true,"builtinName":0,"traits":0,"interpolation":1,"tracks":[],"events":[],"isCreationTrack":false,"modifiers":[],},
|
||||
],
|
||||
"visibleRange": null,
|
||||
"lockOrigin": false,
|
||||
"showBackdrop": true,
|
||||
"showBackdropImage": false,
|
||||
"backdropImagePath": "",
|
||||
"backdropImageOpacity": 0.5,
|
||||
"backdropWidth": 1366,
|
||||
"backdropHeight": 768,
|
||||
"backdropXOffset": 0.0,
|
||||
"backdropYOffset": 0.0,
|
||||
"xorigin": 32,
|
||||
"yorigin": 32,
|
||||
"eventToFunction": {},
|
||||
"eventStubScript": null,
|
||||
},
|
||||
"layers": [
|
||||
{"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"0ab9f754-9684-4551-ba84-8e94f04c058b","visible":true,"isLocked":false,"blendMode":0,"opacity":100.0,"displayName":"default",},
|
||||
],
|
||||
"nineSlice": null,
|
||||
"parent": {
|
||||
"name": "node",
|
||||
"path": "folders/nodes/icons/node.yy",
|
||||
},
|
||||
}
|
|
@ -48,7 +48,7 @@
|
|||
{"id":"dfdfa85e-b8c6-44b1-8057-3f306bc7d333","Key":0.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"c8995f04-9db1-482a-893c-a59ce7e426e2","path":"sprites/s_node_grid_noise/s_node_grid_noise.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe<SpriteFrameKeyframe>",},
|
||||
],"resourceVersion":"1.0","resourceType":"KeyframeStore<SpriteFrameKeyframe>",},"trackColour":0,"inheritsTrackColour":true,"builtinName":0,"traits":0,"interpolation":1,"tracks":[],"events":[],"isCreationTrack":false,"modifiers":[],},
|
||||
],
|
||||
"visibleRange": {"x":0.0,"y":0.0,},
|
||||
"visibleRange": null,
|
||||
"lockOrigin": false,
|
||||
"showBackdrop": true,
|
||||
"showBackdropImage": false,
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
74
sprites/s_node_iterator_amount/s_node_iterator_amount.yy
Normal file
74
sprites/s_node_iterator_amount/s_node_iterator_amount.yy
Normal file
|
@ -0,0 +1,74 @@
|
|||
{
|
||||
"resourceType": "GMSprite",
|
||||
"resourceVersion": "1.0",
|
||||
"name": "s_node_iterator_amount",
|
||||
"bboxMode": 0,
|
||||
"collisionKind": 1,
|
||||
"type": 0,
|
||||
"origin": 4,
|
||||
"preMultiplyAlpha": false,
|
||||
"edgeFiltering": false,
|
||||
"collisionTolerance": 0,
|
||||
"swfPrecision": 2.525,
|
||||
"bbox_left": 5,
|
||||
"bbox_right": 58,
|
||||
"bbox_top": 5,
|
||||
"bbox_bottom": 59,
|
||||
"HTile": false,
|
||||
"VTile": false,
|
||||
"For3D": false,
|
||||
"DynamicTexturePage": false,
|
||||
"width": 64,
|
||||
"height": 64,
|
||||
"textureGroupId": {
|
||||
"name": "Default",
|
||||
"path": "texturegroups/Default",
|
||||
},
|
||||
"swatchColours": null,
|
||||
"gridX": 0,
|
||||
"gridY": 0,
|
||||
"frames": [
|
||||
{"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"a41c1b6a-de41-46f4-b85c-b8ce499ddfb4",},
|
||||
],
|
||||
"sequence": {
|
||||
"resourceType": "GMSequence",
|
||||
"resourceVersion": "1.4",
|
||||
"name": "s_node_iterator_amount",
|
||||
"timeUnits": 1,
|
||||
"playback": 1,
|
||||
"playbackSpeed": 30.0,
|
||||
"playbackSpeedType": 0,
|
||||
"autoRecord": true,
|
||||
"volume": 1.0,
|
||||
"length": 1.0,
|
||||
"events": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore<MessageEventKeyframe>",},
|
||||
"moments": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore<MomentsEventKeyframe>",},
|
||||
"tracks": [
|
||||
{"resourceType":"GMSpriteFramesTrack","resourceVersion":"1.0","name":"frames","spriteId":null,"keyframes":{"Keyframes":[
|
||||
{"id":"79d2c811-5dd6-4704-8733-35bbc72d5c96","Key":0.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"a41c1b6a-de41-46f4-b85c-b8ce499ddfb4","path":"sprites/s_node_iterator_amount/s_node_iterator_amount.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe<SpriteFrameKeyframe>",},
|
||||
],"resourceVersion":"1.0","resourceType":"KeyframeStore<SpriteFrameKeyframe>",},"trackColour":0,"inheritsTrackColour":true,"builtinName":0,"traits":0,"interpolation":1,"tracks":[],"events":[],"isCreationTrack":false,"modifiers":[],},
|
||||
],
|
||||
"visibleRange": null,
|
||||
"lockOrigin": false,
|
||||
"showBackdrop": true,
|
||||
"showBackdropImage": false,
|
||||
"backdropImagePath": "",
|
||||
"backdropImageOpacity": 0.5,
|
||||
"backdropWidth": 1366,
|
||||
"backdropHeight": 768,
|
||||
"backdropXOffset": 0.0,
|
||||
"backdropYOffset": 0.0,
|
||||
"xorigin": 32,
|
||||
"yorigin": 32,
|
||||
"eventToFunction": {},
|
||||
"eventStubScript": null,
|
||||
},
|
||||
"layers": [
|
||||
{"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"0029c8ae-6fba-4656-8fed-55f184dcf049","visible":true,"isLocked":false,"blendMode":0,"opacity":100.0,"displayName":"default",},
|
||||
],
|
||||
"nineSlice": null,
|
||||
"parent": {
|
||||
"name": "node",
|
||||
"path": "folders/nodes/icons/node.yy",
|
||||
},
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 558 B |
Binary file not shown.
After Width: | Height: | Size: 558 B |
74
sprites/s_node_iterator_length/s_node_iterator_length.yy
Normal file
74
sprites/s_node_iterator_length/s_node_iterator_length.yy
Normal file
|
@ -0,0 +1,74 @@
|
|||
{
|
||||
"resourceType": "GMSprite",
|
||||
"resourceVersion": "1.0",
|
||||
"name": "s_node_iterator_length",
|
||||
"bboxMode": 0,
|
||||
"collisionKind": 1,
|
||||
"type": 0,
|
||||
"origin": 4,
|
||||
"preMultiplyAlpha": false,
|
||||
"edgeFiltering": false,
|
||||
"collisionTolerance": 0,
|
||||
"swfPrecision": 2.525,
|
||||
"bbox_left": 0,
|
||||
"bbox_right": 63,
|
||||
"bbox_top": 10,
|
||||
"bbox_bottom": 53,
|
||||
"HTile": false,
|
||||
"VTile": false,
|
||||
"For3D": false,
|
||||
"DynamicTexturePage": false,
|
||||
"width": 64,
|
||||
"height": 64,
|
||||
"textureGroupId": {
|
||||
"name": "Default",
|
||||
"path": "texturegroups/Default",
|
||||
},
|
||||
"swatchColours": null,
|
||||
"gridX": 0,
|
||||
"gridY": 0,
|
||||
"frames": [
|
||||
{"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"bf3c1c69-a52c-42b9-a02e-0196b33d9955",},
|
||||
],
|
||||
"sequence": {
|
||||
"resourceType": "GMSequence",
|
||||
"resourceVersion": "1.4",
|
||||
"name": "s_node_iterator_length",
|
||||
"timeUnits": 1,
|
||||
"playback": 1,
|
||||
"playbackSpeed": 30.0,
|
||||
"playbackSpeedType": 0,
|
||||
"autoRecord": true,
|
||||
"volume": 1.0,
|
||||
"length": 1.0,
|
||||
"events": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore<MessageEventKeyframe>",},
|
||||
"moments": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore<MomentsEventKeyframe>",},
|
||||
"tracks": [
|
||||
{"resourceType":"GMSpriteFramesTrack","resourceVersion":"1.0","name":"frames","spriteId":null,"keyframes":{"Keyframes":[
|
||||
{"id":"cd8830b4-40af-4659-b2de-f81754c76bbb","Key":0.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"bf3c1c69-a52c-42b9-a02e-0196b33d9955","path":"sprites/s_node_iterator_length/s_node_iterator_length.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe<SpriteFrameKeyframe>",},
|
||||
],"resourceVersion":"1.0","resourceType":"KeyframeStore<SpriteFrameKeyframe>",},"trackColour":0,"inheritsTrackColour":true,"builtinName":0,"traits":0,"interpolation":1,"tracks":[],"events":[],"isCreationTrack":false,"modifiers":[],},
|
||||
],
|
||||
"visibleRange": null,
|
||||
"lockOrigin": false,
|
||||
"showBackdrop": true,
|
||||
"showBackdropImage": false,
|
||||
"backdropImagePath": "",
|
||||
"backdropImageOpacity": 0.5,
|
||||
"backdropWidth": 1366,
|
||||
"backdropHeight": 768,
|
||||
"backdropXOffset": 0.0,
|
||||
"backdropYOffset": 0.0,
|
||||
"xorigin": 32,
|
||||
"yorigin": 32,
|
||||
"eventToFunction": {},
|
||||
"eventStubScript": null,
|
||||
},
|
||||
"layers": [
|
||||
{"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"13d238aa-df20-4732-a719-28010df9fe42","visible":true,"isLocked":false,"blendMode":0,"opacity":100.0,"displayName":"default",},
|
||||
],
|
||||
"nineSlice": null,
|
||||
"parent": {
|
||||
"name": "node",
|
||||
"path": "folders/nodes/icons/node.yy",
|
||||
},
|
||||
}
|
Loading…
Reference in a new issue