mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2025-01-23 11:28:06 +01:00
1.13.5
This commit is contained in:
parent
938e83a802
commit
1a3d53b222
114 changed files with 3097 additions and 1759 deletions
|
@ -201,6 +201,7 @@
|
|||
{"name":"node_scatter","order":3,"path":"scripts/node_scatter/node_scatter.yy",},
|
||||
{"name":"s_node_bloom","order":6,"path":"sprites/s_node_bloom/s_node_bloom.yy",},
|
||||
{"name":"s_node_flip","order":12,"path":"sprites/s_node_flip/s_node_flip.yy",},
|
||||
{"name":"s_node_gradient_data","order":17,"path":"sprites/s_node_gradient_data/s_node_gradient_data.yy",},
|
||||
{"name":"s_node_vfx_render","order":1,"path":"sprites/s_node_vfx_render/s_node_vfx_render.yy",},
|
||||
{"name":"node_stack","order":2,"path":"scripts/node_stack/node_stack.yy",},
|
||||
{"name":"s_node_rigidSim_object","order":3,"path":"sprites/s_node_rigidSim_object/s_node_rigidSim_object.yy",},
|
||||
|
@ -420,6 +421,7 @@
|
|||
{"name":"sh_skew","order":6,"path":"shaders/sh_skew/sh_skew.yy",},
|
||||
{"name":"fd_rectangle_get_pressure_height","order":16,"path":"scripts/fd_rectangle_get_pressure_height/fd_rectangle_get_pressure_height.yy",},
|
||||
{"name":"node_VFX_effect_destroy","order":12,"path":"scripts/node_VFX_effect_destroy/node_VFX_effect_destroy.yy",},
|
||||
{"name":"node_cache","order":9,"path":"scripts/node_cache/node_cache.yy",},
|
||||
{"name":"sh_bw","order":5,"path":"shaders/sh_bw/sh_bw.yy",},
|
||||
{"name":"real_comparison","order":1,"path":"scripts/real_comparison/real_comparison.yy",},
|
||||
{"name":"fd_rectangle_get_collision_mask_sprite_image","order":5,"path":"scripts/fd_rectangle_get_collision_mask_sprite_image/fd_rectangle_get_collision_mask_sprite_image.yy",},
|
||||
|
@ -564,6 +566,7 @@
|
|||
{"name":"sh_invert","order":25,"path":"shaders/sh_invert/sh_invert.yy",},
|
||||
{"name":"preview_overlay_puppet","order":4,"path":"scripts/preview_overlay_puppet/preview_overlay_puppet.yy",},
|
||||
{"name":"s_icon_64","order":2,"path":"sprites/s_icon_64/s_icon_64.yy",},
|
||||
{"name":"s_node_gradient_replace","order":18,"path":"sprites/s_node_gradient_replace/s_node_gradient_replace.yy",},
|
||||
{"name":"node_perlin_smear","order":6,"path":"scripts/node_perlin_smear/node_perlin_smear.yy",},
|
||||
{"name":"node_alpha_cutoff","order":10,"path":"scripts/node_alpha_cutoff/node_alpha_cutoff.yy",},
|
||||
{"name":"sh_channel_R","order":4,"path":"shaders/sh_channel_R/sh_channel_R.yy",},
|
||||
|
@ -648,6 +651,7 @@
|
|||
{"name":"s_node_camera","order":3,"path":"sprites/s_node_camera/s_node_camera.yy",},
|
||||
{"name":"sh_vertex_pnt_light","order":4,"path":"shaders/sh_vertex_pnt_light/sh_vertex_pnt_light.yy",},
|
||||
{"name":"surfaceBox","order":22,"path":"scripts/surfaceBox/surfaceBox.yy",},
|
||||
{"name":"node_gradient_palette","order":11,"path":"scripts/node_gradient_palette/node_gradient_palette.yy",},
|
||||
{"name":"s_node_csv_file_read","order":12,"path":"sprites/s_node_csv_file_read/s_node_csv_file_read.yy",},
|
||||
{"name":"node_fluid_domain","order":1,"path":"scripts/node_fluid_domain/node_fluid_domain.yy",},
|
||||
{"name":"s_node_repeat","order":23,"path":"sprites/s_node_repeat/s_node_repeat.yy",},
|
||||
|
@ -760,6 +764,7 @@
|
|||
{"name":"o_dialog_output_visibility","order":2,"path":"objects/o_dialog_output_visibility/o_dialog_output_visibility.yy",},
|
||||
{"name":"node_normal","order":1,"path":"scripts/node_normal/node_normal.yy",},
|
||||
{"name":"s_node_glow","order":22,"path":"sprites/s_node_glow/s_node_glow.yy",},
|
||||
{"name":"node_gradient_replace","order":12,"path":"scripts/node_gradient_replace/node_gradient_replace.yy",},
|
||||
{"name":"s_node_vfx_repel","order":6,"path":"sprites/s_node_vfx_repel/s_node_vfx_repel.yy",},
|
||||
{"name":"fd_rectangle_set_collision_mask_surface","order":2,"path":"scripts/fd_rectangle_set_collision_mask_surface/fd_rectangle_set_collision_mask_surface.yy",},
|
||||
{"name":"node_array_length","order":11,"path":"scripts/node_array_length/node_array_length.yy",},
|
||||
|
@ -832,6 +837,7 @@
|
|||
{"name":"s_node_timeline_preview","order":2,"path":"sprites/s_node_timeline_preview/s_node_timeline_preview.yy",},
|
||||
{"name":"node_csv_file_read","order":9,"path":"scripts/node_csv_file_read/node_csv_file_read.yy",},
|
||||
{"name":"scrollPane","order":14,"path":"scripts/scrollPane/scrollPane.yy",},
|
||||
{"name":"node_gradient_extract","order":13,"path":"scripts/node_gradient_extract/node_gradient_extract.yy",},
|
||||
{"name":"s_node_normal_light","order":29,"path":"sprites/s_node_normal_light/s_node_normal_light.yy",},
|
||||
{"name":"node_transform_single","order":1,"path":"scripts/node_transform_single/node_transform_single.yy",},
|
||||
{"name":"node_fluid_apply_velo","order":5,"path":"scripts/node_fluid_apply_velo/node_fluid_apply_velo.yy",},
|
||||
|
@ -937,6 +943,7 @@
|
|||
{"name":"s_node_group_output","order":15,"path":"sprites/s_node_group_output/s_node_group_output.yy",},
|
||||
{"name":"sh_channel_S","order":5,"path":"shaders/sh_channel_S/sh_channel_S.yy",},
|
||||
{"name":"string_scale","order":6,"path":"scripts/string_scale/string_scale.yy",},
|
||||
{"name":"s_node_cache","order":27,"path":"sprites/s_node_cache/s_node_cache.yy",},
|
||||
{"name":"node_repeat","order":26,"path":"scripts/node_repeat/node_repeat.yy",},
|
||||
{"name":"sh_fd_advect_velocity_1_glsl","order":7,"path":"shaders/sh_fd_advect_velocity_1_glsl/sh_fd_advect_velocity_1_glsl.yy",},
|
||||
{"name":"s_node_image","order":4,"path":"sprites/s_node_image/s_node_image.yy",},
|
||||
|
@ -1006,6 +1013,7 @@
|
|||
{"name":"fd_rectangle_get_material_width","order":15,"path":"scripts/fd_rectangle_get_material_width/fd_rectangle_get_material_width.yy",},
|
||||
{"name":"font_sprite_loader","order":10,"path":"scripts/font_sprite_loader/font_sprite_loader.yy",},
|
||||
{"name":"s_node_noise_aniso","order":9,"path":"sprites/s_node_noise_aniso/s_node_noise_aniso.yy",},
|
||||
{"name":"s_node_gradient_palette","order":16,"path":"sprites/s_node_gradient_palette/s_node_gradient_palette.yy",},
|
||||
{"name":"node_array_shuffle","order":22,"path":"scripts/node_array_shuffle/node_array_shuffle.yy",},
|
||||
{"name":"fd_rectangle_update_material","order":21,"path":"scripts/fd_rectangle_update_material/fd_rectangle_update_material.yy",},
|
||||
{"name":"sh_perlin_tiled","order":2,"path":"shaders/sh_perlin_tiled/sh_perlin_tiled.yy",},
|
||||
|
|
|
@ -234,6 +234,7 @@
|
|||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_junc_visible_strip2.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_loading_s.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_loading.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_lock.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_loop_16.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_minus_24.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_name.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
|
||||
|
@ -269,6 +270,7 @@
|
|||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_timeline_clock.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_timeline_graph.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_timeline_keyframe_strip4.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_tunnel.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_undo.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_unit_ref.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_vfx.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
|
||||
|
@ -560,6 +562,7 @@
|
|||
{"id":{"name":"s_node_bloom","path":"sprites/s_node_bloom/s_node_bloom.yy",},"order":6,},
|
||||
{"id":{"name":"node_image","path":"scripts/node_image/node_image.yy",},"order":0,},
|
||||
{"id":{"name":"s_node_flip","path":"sprites/s_node_flip/s_node_flip.yy",},"order":12,},
|
||||
{"id":{"name":"s_node_gradient_data","path":"sprites/s_node_gradient_data/s_node_gradient_data.yy",},"order":17,},
|
||||
{"id":{"name":"s_node_vfx_render","path":"sprites/s_node_vfx_render/s_node_vfx_render.yy",},"order":1,},
|
||||
{"id":{"name":"node_stack","path":"scripts/node_stack/node_stack.yy",},"order":2,},
|
||||
{"id":{"name":"sh_cell_noise","path":"shaders/sh_cell_noise/sh_cell_noise.yy",},"order":0,},
|
||||
|
@ -814,6 +817,7 @@
|
|||
{"id":{"name":"fd_rectangle_get_pressure_height","path":"scripts/fd_rectangle_get_pressure_height/fd_rectangle_get_pressure_height.yy",},"order":16,},
|
||||
{"id":{"name":"s_node_fluidSim_repulse","path":"sprites/s_node_fluidSim_repulse/s_node_fluidSim_repulse.yy",},"order":0,},
|
||||
{"id":{"name":"node_VFX_effect_destroy","path":"scripts/node_VFX_effect_destroy/node_VFX_effect_destroy.yy",},"order":12,},
|
||||
{"id":{"name":"node_cache","path":"scripts/node_cache/node_cache.yy",},"order":9,},
|
||||
{"id":{"name":"sh_bw","path":"shaders/sh_bw/sh_bw.yy",},"order":5,},
|
||||
{"id":{"name":"real_comparison","path":"scripts/real_comparison/real_comparison.yy",},"order":1,},
|
||||
{"id":{"name":"sh_sdf_tex","path":"shaders/sh_sdf_tex/sh_sdf_tex.yy",},"order":0,},
|
||||
|
@ -977,6 +981,7 @@
|
|||
{"id":{"name":"preview_overlay_puppet","path":"scripts/preview_overlay_puppet/preview_overlay_puppet.yy",},"order":4,},
|
||||
{"id":{"name":"s_icon_64","path":"sprites/s_icon_64/s_icon_64.yy",},"order":2,},
|
||||
{"id":{"name":"save_function","path":"scripts/save_function/save_function.yy",},"order":0,},
|
||||
{"id":{"name":"s_node_gradient_replace","path":"sprites/s_node_gradient_replace/s_node_gradient_replace.yy",},"order":18,},
|
||||
{"id":{"name":"node_perlin_smear","path":"scripts/node_perlin_smear/node_perlin_smear.yy",},"order":6,},
|
||||
{"id":{"name":"node_alpha_cutoff","path":"scripts/node_alpha_cutoff/node_alpha_cutoff.yy",},"order":10,},
|
||||
{"id":{"name":"sh_channel_R","path":"shaders/sh_channel_R/sh_channel_R.yy",},"order":4,},
|
||||
|
@ -1067,6 +1072,7 @@
|
|||
{"id":{"name":"s_node_camera","path":"sprites/s_node_camera/s_node_camera.yy",},"order":3,},
|
||||
{"id":{"name":"sh_vertex_pnt_light","path":"shaders/sh_vertex_pnt_light/sh_vertex_pnt_light.yy",},"order":4,},
|
||||
{"id":{"name":"surfaceBox","path":"scripts/surfaceBox/surfaceBox.yy",},"order":22,},
|
||||
{"id":{"name":"node_gradient_palette","path":"scripts/node_gradient_palette/node_gradient_palette.yy",},"order":11,},
|
||||
{"id":{"name":"s_node_csv_file_read","path":"sprites/s_node_csv_file_read/s_node_csv_file_read.yy",},"order":12,},
|
||||
{"id":{"name":"variable_data","path":"scripts/variable_data/variable_data.yy",},"order":0,},
|
||||
{"id":{"name":"node_fluid_domain","path":"scripts/node_fluid_domain/node_fluid_domain.yy",},"order":1,},
|
||||
|
@ -1195,6 +1201,7 @@
|
|||
{"id":{"name":"o_dialog_output_visibility","path":"objects/o_dialog_output_visibility/o_dialog_output_visibility.yy",},"order":2,},
|
||||
{"id":{"name":"node_normal","path":"scripts/node_normal/node_normal.yy",},"order":1,},
|
||||
{"id":{"name":"s_node_glow","path":"sprites/s_node_glow/s_node_glow.yy",},"order":22,},
|
||||
{"id":{"name":"node_gradient_replace","path":"scripts/node_gradient_replace/node_gradient_replace.yy",},"order":12,},
|
||||
{"id":{"name":"s_node_condition","path":"sprites/s_node_condition/s_node_condition.yy",},"order":0,},
|
||||
{"id":{"name":"s_node_vfx_repel","path":"sprites/s_node_vfx_repel/s_node_vfx_repel.yy",},"order":6,},
|
||||
{"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,},
|
||||
|
@ -1285,6 +1292,7 @@
|
|||
{"id":{"name":"s_node_timeline_preview","path":"sprites/s_node_timeline_preview/s_node_timeline_preview.yy",},"order":2,},
|
||||
{"id":{"name":"node_csv_file_read","path":"scripts/node_csv_file_read/node_csv_file_read.yy",},"order":9,},
|
||||
{"id":{"name":"scrollPane","path":"scripts/scrollPane/scrollPane.yy",},"order":14,},
|
||||
{"id":{"name":"node_gradient_extract","path":"scripts/node_gradient_extract/node_gradient_extract.yy",},"order":13,},
|
||||
{"id":{"name":"s_node_normal_light","path":"sprites/s_node_normal_light/s_node_normal_light.yy",},"order":29,},
|
||||
{"id":{"name":"node_transform_single","path":"scripts/node_transform_single/node_transform_single.yy",},"order":1,},
|
||||
{"id":{"name":"node_fluid_apply_velo","path":"scripts/node_fluid_apply_velo/node_fluid_apply_velo.yy",},"order":5,},
|
||||
|
@ -1404,6 +1412,7 @@
|
|||
{"id":{"name":"s_node_group_output","path":"sprites/s_node_group_output/s_node_group_output.yy",},"order":15,},
|
||||
{"id":{"name":"sh_channel_S","path":"shaders/sh_channel_S/sh_channel_S.yy",},"order":5,},
|
||||
{"id":{"name":"string_scale","path":"scripts/string_scale/string_scale.yy",},"order":6,},
|
||||
{"id":{"name":"s_node_cache","path":"sprites/s_node_cache/s_node_cache.yy",},"order":27,},
|
||||
{"id":{"name":"node_logic_operate","path":"scripts/node_logic_operate/node_logic_operate.yy",},"order":0,},
|
||||
{"id":{"name":"node_repeat","path":"scripts/node_repeat/node_repeat.yy",},"order":26,},
|
||||
{"id":{"name":"sh_fd_advect_velocity_1_glsl","path":"shaders/sh_fd_advect_velocity_1_glsl/sh_fd_advect_velocity_1_glsl.yy",},"order":7,},
|
||||
|
@ -1488,6 +1497,7 @@
|
|||
{"id":{"name":"font_sprite_loader","path":"scripts/font_sprite_loader/font_sprite_loader.yy",},"order":10,},
|
||||
{"id":{"name":"s_node_noise_aniso","path":"sprites/s_node_noise_aniso/s_node_noise_aniso.yy",},"order":9,},
|
||||
{"id":{"name":"steam_ugc_functions","path":"scripts/steam_ugc_functions/steam_ugc_functions.yy",},"order":0,},
|
||||
{"id":{"name":"s_node_gradient_palette","path":"sprites/s_node_gradient_palette/s_node_gradient_palette.yy",},"order":16,},
|
||||
{"id":{"name":"node_array_shuffle","path":"scripts/node_array_shuffle/node_array_shuffle.yy",},"order":22,},
|
||||
{"id":{"name":"fd_rectangle_update_material","path":"scripts/fd_rectangle_update_material/fd_rectangle_update_material.yy",},"order":21,},
|
||||
{"id":{"name":"sh_perlin_tiled","path":"shaders/sh_perlin_tiled/sh_perlin_tiled.yy",},"order":2,},
|
||||
|
|
File diff suppressed because one or more lines are too long
Binary file not shown.
|
@ -1093,6 +1093,20 @@
|
|||
"yorigin": 24,
|
||||
"slice": null
|
||||
},
|
||||
"tunnel": {
|
||||
"path": "./icon/s_tunnel.png",
|
||||
"subimages": 2,
|
||||
"xorigin": 24,
|
||||
"yorigin": 24,
|
||||
"slice": null
|
||||
},
|
||||
"lock": {
|
||||
"path": "./icon/s_lock.png",
|
||||
"subimages": 2,
|
||||
"xorigin": 24,
|
||||
"yorigin": 24,
|
||||
"slice": null
|
||||
},
|
||||
"menu_button": {
|
||||
"path": "./UI/s_menu_button.png",
|
||||
"subimages": 1,
|
||||
|
|
File diff suppressed because it is too large
Load diff
BIN
datafiles/data/themes/default/graphics/icon/s_lock.png
Normal file
BIN
datafiles/data/themes/default/graphics/icon/s_lock.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 649 B |
BIN
datafiles/data/themes/default/graphics/icon/s_tunnel.png
Normal file
BIN
datafiles/data/themes/default/graphics/icon/s_tunnel.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
|
@ -37,8 +37,8 @@
|
|||
if(!draggable) return;
|
||||
|
||||
if(dialog_dragging) {
|
||||
dialog_x = dialog_drag_sx + mouse_mx - dialog_drag_mx;
|
||||
dialog_y = dialog_drag_sy + mouse_my - dialog_drag_my;
|
||||
dialog_x = clamp(dialog_drag_sx + mouse_mx - dialog_drag_mx, 0, WIN_W);
|
||||
dialog_y = clamp(dialog_drag_sy + mouse_my - dialog_drag_my, ui(40), WIN_H);
|
||||
|
||||
if(mouse_release(mb_left))
|
||||
dialog_dragging = false;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/// @description
|
||||
event_inherited();
|
||||
|
||||
WIDGET_CURRENT = noone;
|
||||
WIDGET_CURRENT = noone;
|
||||
instance_destroy(o_dialog_menubox);
|
|
@ -2,6 +2,7 @@
|
|||
if !ready exit;
|
||||
|
||||
#region dropper
|
||||
selector.interactable = interactable;
|
||||
if(selector.dropper_active) {
|
||||
selector.drawDropper(self);
|
||||
exit;
|
||||
|
@ -24,7 +25,9 @@ if !ready exit;
|
|||
|
||||
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title);
|
||||
draw_text(presets_x + ui(24), dialog_y + ui(16), get_text("palette", "Palettes"));
|
||||
draw_text(content_x + ui(24), dialog_y + ui(16), name);
|
||||
draw_text(content_x + (!interactable * ui(32)) + ui(24), dialog_y + ui(16), name);
|
||||
if(!interactable)
|
||||
draw_sprite_ui(THEME.lock, 0, content_x + ui(24 + 12), dialog_y + ui(16 + 12),,,, COLORS._main_icon);
|
||||
#endregion
|
||||
|
||||
#region palette
|
||||
|
|
|
@ -8,7 +8,6 @@ event_inherited();
|
|||
|
||||
name = get_text("gradient_editor_title", "Gradient editor");
|
||||
gradient = noone;
|
||||
grad_data = noone;
|
||||
interactable = true;
|
||||
|
||||
key_selecting = noone;
|
||||
|
@ -32,34 +31,23 @@ event_inherited();
|
|||
onApply(gradient);
|
||||
}
|
||||
|
||||
function setGradient(grad, data) {
|
||||
gradient = grad;
|
||||
grad_data = data;
|
||||
if(array_length(grad))
|
||||
key_selecting = grad[0];
|
||||
function setGradient(grad) {
|
||||
gradient = grad;
|
||||
if(array_length(grad.keys))
|
||||
key_selecting = grad.keys[0];
|
||||
}
|
||||
|
||||
selector = new colorSelector(setColor);
|
||||
selector.dropper_close = false;
|
||||
|
||||
previous_gradient = [];
|
||||
previous_data = 0;
|
||||
previous_gradient = noone;
|
||||
|
||||
function setDefault(grad, data) {
|
||||
var _grad = [];
|
||||
for( var i = 0; i < array_length(grad); i++ )
|
||||
_grad[i] = grad[i].clone();
|
||||
|
||||
setGradient(_grad, data);
|
||||
previous_data = data[| 0];
|
||||
|
||||
previous_gradient = [];
|
||||
for( var i = 0; i < array_length(grad); i++ )
|
||||
array_push(previous_gradient, grad[i].clone());
|
||||
function setDefault(grad) {
|
||||
setGradient(grad);
|
||||
previous_gradient = grad.clone();
|
||||
}
|
||||
|
||||
b_cancel = button(function() {
|
||||
grad_data[| 0] = previous_data;
|
||||
onApply(previous_gradient);
|
||||
DIALOG_CLICK = false;
|
||||
instance_destroy();
|
||||
|
@ -74,20 +62,21 @@ event_inherited();
|
|||
function setKeyPosition(key, position) {
|
||||
key.time = position;
|
||||
|
||||
array_remove(gradient, key);
|
||||
gradient_add(gradient, key, false);
|
||||
array_remove(gradient.keys, key);
|
||||
gradient.add(key, false);
|
||||
|
||||
onApply(gradient);
|
||||
}
|
||||
|
||||
function removeKeyOverlap(key) {
|
||||
for(var i = 0; i < array_length(gradient); i++) {
|
||||
var _key = gradient[i];
|
||||
var keys = gradient.keys;
|
||||
for(var i = 0; i < array_length(keys); i++) {
|
||||
var _key = keys[i];
|
||||
if(_key == key || _key.time != key.time)
|
||||
continue;
|
||||
|
||||
_key.value = key.value;
|
||||
array_remove(gradient, key);
|
||||
array_remove(keys, key);
|
||||
}
|
||||
|
||||
onApply(gradient);
|
||||
|
@ -99,7 +88,9 @@ event_inherited();
|
|||
if(path == "") return noone;
|
||||
if(!file_exists(path)) return noone;
|
||||
|
||||
var grad = [];
|
||||
var grad = new gradientObject();
|
||||
grad.keys = [];
|
||||
|
||||
var _t = file_text_open_read(path);
|
||||
while(!file_text_eof(_t)) {
|
||||
var key = file_text_readln(_t);
|
||||
|
@ -117,7 +108,7 @@ event_inherited();
|
|||
_pos = toNumber(file_text_readln(_t));
|
||||
}
|
||||
|
||||
array_push(grad, new gradientKey(_pos, _col));
|
||||
array_push(grad.keys, new gradientKey(_pos, _col));
|
||||
}
|
||||
file_text_close(_t);
|
||||
return grad;
|
||||
|
@ -141,6 +132,7 @@ event_inherited();
|
|||
}
|
||||
presetCollect();
|
||||
|
||||
hovering_name = "";
|
||||
sp_preset_w = ui(240 - 32 - 16);
|
||||
sp_presets = new scrollPane(sp_preset_w, dialog_h - ui(62), function(_y, _m) {
|
||||
var ww = sp_preset_w - ui(40);
|
||||
|
@ -159,13 +151,21 @@ event_inherited();
|
|||
|
||||
draw_set_text(f_p2, fa_left, fa_top, COLORS._main_text_sub);
|
||||
draw_text(ui(16), yy + ui(8), filename_name_only(preset_name[| i]));
|
||||
draw_gradient(ui(16), yy + ui(28), ww, ui(16), presets[| i]);
|
||||
presets[| i].draw(ui(16), yy + ui(28), ww, ui(16));
|
||||
|
||||
if(_hover && isHover && mouse_press(mb_left, interactable && sFOCUS)) {
|
||||
var target = presets[| i];
|
||||
gradient = [];
|
||||
for( var i = 0; i < array_length(target); i++ )
|
||||
array_push(gradient, new gradientKey(target[i].time, target[i].value));
|
||||
if(_hover && isHover) {
|
||||
if(mouse_press(mb_left, interactable && sFOCUS))
|
||||
gradient.keys = presets[| i].keys;
|
||||
|
||||
if(mouse_press(mb_right, interactable && sFOCUS)) {
|
||||
hovering_name = preset_name[| i];
|
||||
menuCall(,, [
|
||||
menuItem("Delete gradient", function() {
|
||||
file_delete( DIRECTORY + "Gradients/" + hovering_name);
|
||||
presetCollect();
|
||||
})
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
yy += hg + ui(4);
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
if !ready exit;
|
||||
|
||||
#region dropper
|
||||
selector.interactable = interactable;
|
||||
if(selector.dropper_active) {
|
||||
selector.drawDropper(self);
|
||||
exit;
|
||||
|
@ -28,7 +29,9 @@ if !ready exit;
|
|||
|
||||
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title);
|
||||
draw_text(presets_x + ui(24), dialog_y + ui(16), get_text("presets", "Presets"));
|
||||
draw_text(content_x + ui(24), dialog_y + ui(16), name);
|
||||
draw_text(content_x + (!interactable * ui(32)) + ui(24), dialog_y + ui(16), name);
|
||||
if(!interactable)
|
||||
draw_sprite_ui(THEME.lock, 0, content_x + ui(24 + 12), dialog_y + ui(16 + 12),,,, COLORS._main_icon);
|
||||
draw_text(palette_x + ui(24), dialog_y + ui(16), get_text("palette", "Palettes"));
|
||||
#endregion
|
||||
|
||||
|
@ -47,8 +50,8 @@ if !ready exit;
|
|||
var dia = dialogCall(o_dialog_file_name, mouse_mx + ui(8), mouse_my + ui(8));
|
||||
dia.onModify = function (txt) {
|
||||
var gradStr = "";
|
||||
for(var i = 0; i < array_length(gradient); i++) {
|
||||
var gr = gradient[i];
|
||||
for(var i = 0; i < array_length(gradient.keys); i++) {
|
||||
var gr = gradient.keys[i];
|
||||
var cc = gr.value;
|
||||
var tt = gr.time;
|
||||
|
||||
|
@ -96,9 +99,9 @@ if !ready exit;
|
|||
|
||||
if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, interactable && sFOCUS, sHOVER, get_text("gradient_editor_key_blend", "Key blending"), THEME.grad_blend) == 2) {
|
||||
menuCall( bx + ui(32), by, [
|
||||
menuItem(get_text("gradient_editor_blend_RGB", "RGB blend"), function() { grad_data[| 0] = 0; onApply(gradient); }),
|
||||
menuItem(get_text("gradient_editor_blend_HSV", "HSV blend"), function() { grad_data[| 0] = 2; onApply(gradient); }),
|
||||
menuItem(get_text("gradient_editor_blend_hard", "Hard blend"), function() { grad_data[| 0] = 1; onApply(gradient); }),
|
||||
menuItem(get_text("gradient_editor_blend_RGB", "RGB blend"), function() { gradient.type = 0; onApply(gradient); }),
|
||||
menuItem(get_text("gradient_editor_blend_HSV", "HSV blend"), function() { gradient.type = 2; onApply(gradient); }),
|
||||
menuItem(get_text("gradient_editor_blend_hard", "Hard blend"), function() { gradient.type = 1; onApply(gradient); }),
|
||||
]);
|
||||
}
|
||||
bx -= ui(32);
|
||||
|
@ -106,11 +109,11 @@ if !ready exit;
|
|||
|
||||
draw_sprite_stretched(THEME.textbox, 3, gr_x - ui(6), gr_y - ui(6), gr_w + ui(12), gr_h + ui(12));
|
||||
draw_sprite_stretched(THEME.textbox, 0, gr_x - ui(6), gr_y - ui(6), gr_w + ui(12), gr_h + ui(12));
|
||||
draw_gradient(gr_x, gr_y, gr_w, gr_h, gradient, grad_data[| 0]);
|
||||
gradient.draw(gr_x, gr_y, gr_w, gr_h);
|
||||
|
||||
var hover = noone;
|
||||
for(var i = 0; i < array_length(gradient); i++) {
|
||||
var _k = gradient[i];
|
||||
for(var i = 0; i < array_length(gradient.keys); i++) {
|
||||
var _k = gradient.keys[i];
|
||||
var _c = _k.value;
|
||||
var _kx = gr_x + _k.time * gr_w;
|
||||
var _in = _k == key_selecting? 1 : 0;
|
||||
|
@ -161,9 +164,9 @@ if !ready exit;
|
|||
key_selecting = noone;
|
||||
|
||||
var tt = clamp((mouse_mx - gr_x) / gr_w, 0, 1);
|
||||
var cc = gradient_eval(gradient, tt);
|
||||
var cc = gradient.eval(tt);
|
||||
var _newkey = new gradientKey(tt, cc);
|
||||
gradient_add(gradient, _newkey, true);
|
||||
gradient.add(_newkey, true);
|
||||
|
||||
key_selecting = _newkey;
|
||||
key_dragging = _newkey;
|
||||
|
@ -175,8 +178,8 @@ if !ready exit;
|
|||
}
|
||||
}
|
||||
|
||||
if(mouse_press(mb_right, interactable && sFOCUS) && hover && array_length(gradient) > 1)
|
||||
array_remove(gradient, hover);
|
||||
if(mouse_press(mb_right, interactable && sFOCUS) && hover && array_length(gradient.keys) > 1)
|
||||
array_remove(gradient.keys, hover);
|
||||
}
|
||||
|
||||
var op_x = content_x + ui(20);
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
if(instanceof(_menuItem) == "MenuItemGroup") {
|
||||
var _submenus = _menuItem.group;
|
||||
draw_set_text(f_p1, fa_center, fa_center, COLORS._main_text_sub);
|
||||
draw_set_alpha(_menuItem.active * 0.5 + 0.5);
|
||||
draw_set_alpha(_menuItem.active * 0.75 + 0.25);
|
||||
draw_text(dialog_x + dialog_w / 2, yy + hght / 2, label);
|
||||
draw_set_alpha(1);
|
||||
|
||||
|
@ -84,11 +84,11 @@
|
|||
if(_menuItem.spr != noone) {
|
||||
var spr = is_array(_menuItem.spr)? _menuItem.spr[0] : _menuItem.spr;
|
||||
var ind = is_array(_menuItem.spr)? _menuItem.spr[1] : 0;
|
||||
draw_sprite_ui(spr, ind, dialog_x + ui(24), yy + hght / 2,,,, COLORS._main_icon, 0.75);
|
||||
draw_sprite_ui(spr, ind, dialog_x + ui(24), yy + hght / 2,,,, COLORS._main_icon, _menuItem.active * 0.5 + 0.25);
|
||||
}
|
||||
|
||||
draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text);
|
||||
draw_set_alpha(_menuItem.active * 0.5 + 0.5);
|
||||
draw_set_alpha(_menuItem.active * 0.75 + 0.25);
|
||||
draw_text(tx, yy + hght / 2, label);
|
||||
draw_set_alpha(1);
|
||||
|
||||
|
@ -98,7 +98,9 @@
|
|||
var _key = find_hotkey(_menuItem.hotkey[0], _menuItem.hotkey[1]);
|
||||
if(_key) {
|
||||
draw_set_text(f_p1, fa_right, fa_center, COLORS._main_text_sub);
|
||||
draw_set_alpha(_menuItem.active * 0.75 + 0.25);
|
||||
draw_text(dialog_x + dialog_w - ui(16), yy + hght / 2, key_get_name(_key.key, _key.modi));
|
||||
draw_set_alpha(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,6 +72,8 @@ event_inherited();
|
|||
}
|
||||
presetCollect();
|
||||
|
||||
hovering_name = "";
|
||||
|
||||
sp_preset_w = ui(240 - 32 - 16);
|
||||
sp_presets = new scrollPane(sp_preset_w, dialog_h - ui(62), function(_y, _m) {
|
||||
var ww = sp_preset_w - ui(40);
|
||||
|
@ -90,10 +92,21 @@ event_inherited();
|
|||
draw_text(ui(16), yy + ui(8), filename_name_only(preset_name[| i]));
|
||||
drawPalette(presets[| i], ui(16), yy + ui(28), ww, ui(16));
|
||||
|
||||
if(isHover && mouse_press(mb_left, interactable && sFOCUS)) {
|
||||
palette = array_create(array_length(presets[| i]));
|
||||
for( var j = 0; j < array_length(presets[| i]); j++ ) {
|
||||
palette[j] = presets[| i][j];
|
||||
if(isHover) {
|
||||
if(mouse_press(mb_left, interactable && sFOCUS)) {
|
||||
palette = array_create(array_length(presets[| i]));
|
||||
for( var j = 0; j < array_length(presets[| i]); j++ )
|
||||
palette[j] = presets[| i][j];
|
||||
}
|
||||
|
||||
if(mouse_press(mb_right, interactable && sFOCUS)) {
|
||||
hovering_name = preset_name[| i];
|
||||
menuCall(,, [
|
||||
menuItem("Delete palette", function() {
|
||||
file_delete( DIRECTORY + "Palettes/" + hovering_name);
|
||||
presetCollect();
|
||||
})
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ if !ready exit;
|
|||
if palette == 0 exit;
|
||||
|
||||
#region dropper
|
||||
selector.interactable = interactable;
|
||||
if(selector.dropper_active) {
|
||||
selector.drawDropper(self);
|
||||
exit;
|
||||
|
@ -24,7 +25,9 @@ if palette == 0 exit;
|
|||
|
||||
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title);
|
||||
draw_text(presets_x + ui(24), dialog_y + ui(16), get_text("presets", "Presets"));
|
||||
draw_text(content_x + ui(24), dialog_y + ui(16), name);
|
||||
draw_text(content_x + (!interactable * ui(32)) + ui(24), dialog_y + ui(16), name);
|
||||
if(!interactable)
|
||||
draw_sprite_ui(THEME.lock, 0, content_x + ui(24 + 12), dialog_y + ui(16 + 12),,,, COLORS._main_icon);
|
||||
#endregion
|
||||
|
||||
#region presets
|
||||
|
|
|
@ -19,18 +19,39 @@ if(node_target == noone) {
|
|||
|
||||
surface_set_target(content_surface);
|
||||
draw_clear_alpha(c_black, 0);
|
||||
var surf = node_target.outputs[| preview_channel].getValue();
|
||||
if(!is_surface(surf)) return;
|
||||
|
||||
var sw = surface_get_width(surf);
|
||||
var sh = surface_get_height(surf);
|
||||
if(scale == 0)
|
||||
scale = min(pw / sw, ph / sh);
|
||||
var sx = pw / 2 - (sw * scale) / 2 + panx;
|
||||
var sy = ph / 2 - (sh * scale) / 2 + pany;
|
||||
|
||||
draw_sprite_tiled(s_transparent, 0, 0, 0);
|
||||
draw_surface_ext(surf, sx, sy, scale, scale, 0, c_white, 1);
|
||||
|
||||
var surf = node_target.outputs[| preview_channel].getValue();
|
||||
if(is_array(surf))
|
||||
surf = array_spread(surf);
|
||||
else
|
||||
surf = [ surf ];
|
||||
|
||||
var dx = 0;
|
||||
var dy = 0;
|
||||
var ind = 0;
|
||||
var col = round(sqrt(array_length(surf)));
|
||||
|
||||
for( var i = 0; i < array_length(surf); i++ ) {
|
||||
var s = surf[i];
|
||||
var sw = surface_get_width(s);
|
||||
var sh = surface_get_height(s);
|
||||
if(scale == 0)
|
||||
scale = min(pw / sw, ph / sh);
|
||||
var sx = dx + pw / 2 - (sw * scale) / 2 + panx;
|
||||
var sy = dy + ph / 2 - (sh * scale) / 2 + pany;
|
||||
|
||||
draw_surface_ext(s, sx, sy, scale, scale, 0, c_white, 1);
|
||||
draw_set_color(COLORS._main_icon);
|
||||
draw_rectangle(sx, sy, sx + sw * scale, sy + sh * scale, true);
|
||||
|
||||
if(++ind >= col) {
|
||||
ind = 0;
|
||||
dx = 0;
|
||||
dy += (sh + 2) * scale;
|
||||
} else
|
||||
dx += (sw + 2) * scale;
|
||||
}
|
||||
surface_reset_target();
|
||||
draw_surface(content_surface, px, py);
|
||||
|
||||
|
@ -68,7 +89,7 @@ if(node_target == noone) {
|
|||
|
||||
draw_sprite_stretched_ext(THEME.dialog_bg, 0, dialog_x, dialog_y, dialog_w, title_height, c_white, title_show);
|
||||
|
||||
draw_set_alpha(title_show);
|
||||
draw_set_alpha(0.5 + title_show * 0.5);
|
||||
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text_title);
|
||||
draw_text(dialog_x + ui(padding + 8), dialog_y + ui(title_height) / 2, node_target.getFullName());
|
||||
draw_set_alpha(1);
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
draw_tooltip_surface(content);
|
||||
break;
|
||||
case VALUE_TYPE.rigid :
|
||||
draw_tooltip_text("[" + get_text("tooltip_rigid_object", "Rigidbody Object") + "id: " + string(content) + "]");
|
||||
draw_tooltip_text("[" + get_text("tooltip_rigid_object", "Rigidbody Object") + "id: " + string(content[$ "object"]) + "]");
|
||||
break;
|
||||
case VALUE_TYPE.particle :
|
||||
draw_tooltip_text("[" + get_text("tooltip_particle_object", "Particle Object") + "]");
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
/// @description init
|
||||
#region animation
|
||||
ANIMATOR.frame_progress = false;
|
||||
|
||||
if(ANIMATOR.is_playing && ANIMATOR.play_freeze == 0) {
|
||||
ANIMATOR.time_since_last_frame += ANIMATOR.framerate * (delta_time / 1000000);
|
||||
|
||||
if(ANIMATOR.time_since_last_frame >= 1)
|
||||
ANIMATOR.setFrame(ANIMATOR.real_frame + 1);
|
||||
} else {
|
||||
ANIMATOR.frame_progress = false;
|
||||
ANIMATOR.setFrame(ANIMATOR.real_frame);
|
||||
ANIMATOR.time_since_last_frame = 0;
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
"option_windows_description_info": "Pixel Composer",
|
||||
"option_windows_disable_sandbox": true,
|
||||
"option_windows_display_cursor": true,
|
||||
"option_windows_display_name": "Pixel Composer 1.13.4",
|
||||
"option_windows_display_name": "Pixel Composer 1.13.5",
|
||||
"option_windows_enable_steam": false,
|
||||
"option_windows_executable_name": "PixelComposer.exe",
|
||||
"option_windows_icon": "icons/icon.ico",
|
||||
|
@ -33,6 +33,6 @@
|
|||
"option_windows_steam_use_alternative_launcher": false,
|
||||
"option_windows_texture_page": "2048x2048",
|
||||
"option_windows_use_splash": false,
|
||||
"option_windows_version": "1.13.4.0",
|
||||
"option_windows_version": "1.13.5.0",
|
||||
"option_windows_vsync": false,
|
||||
}
|
|
@ -59,6 +59,14 @@ function __lua_set_color_alpha(color = c_white, alpha = 1) {
|
|||
draw_set_color(color);
|
||||
draw_set_alpha(alpha);
|
||||
}
|
||||
function __lua_get_color(_x, _y) {
|
||||
var surf = surface_get_target();
|
||||
if(!is_surface(surf)) return 0;
|
||||
return surface_getpixel_ext(surf, _x, _y);
|
||||
}
|
||||
function __lua_get_color_surface(surface, _x, _y) {
|
||||
return surface_getpixel_ext(surface, _x, _y);
|
||||
}
|
||||
|
||||
function __lua_color_make_rgb(r, g, b, normalize = false) {
|
||||
if(normalize)
|
||||
|
@ -108,7 +116,11 @@ function __initLua() {
|
|||
[["alpha", "number", "Draw alpha"], ]],
|
||||
["setColorAlpha", __lua_set_color_alpha, "setColorAlpha(color = white, alpha = 1)", "Set current drawing color and alpha.",
|
||||
[["color", "color", "Draw color"], ["alpha", "number", "Draw alpha"], ]],
|
||||
|
||||
["getColor", __lua_get_color, "getColor(x, y)", "Get color from current surface.",
|
||||
[["x", "number", "Sample x position"], ["y", "number", "Sample y position"], ]],
|
||||
["getColorSurface", __lua_get_color_surface, "getColorSurface(surface, x, y)", "Get color from surface.",
|
||||
[["surface", "surface", "Surface to get color from"], ["x", "number", "Sample x position"], ["y", "number", "Sample y position"], ]],
|
||||
|
||||
["drawRect", __lua_draw_rectangle, "drawRect(x0, y0, x1, y1)", "Draw filled rectangle.",
|
||||
[["x0", "number", "Left position"], ["y0", "number", "Top position"], ["x1", "number", "Right position"], ["y1", "number", "Bottom position"], ]],
|
||||
["drawRectOutline", __lua_draw_rectangle_outline, "drawRectOutline(x0, y0, x1, y1, thick = 1)", "Draw rectangle outline.",
|
||||
|
|
|
@ -183,7 +183,7 @@ function __part(_node) constructor {
|
|||
|
||||
if(x0 > surf_w || y0 > surf_h || x1 < 0 || y1 < 0) return; //culling
|
||||
|
||||
var cc = (col == -1)? c_white : gradient_eval(col, lifeRat);
|
||||
var cc = (col == -1)? c_white : col.eval(lifeRat);
|
||||
if(blend != c_white) cc = colorMultiply(blend, cc);
|
||||
alp_draw = alp * eval_curve_x(alp_fade, lifeRat);
|
||||
draw_surface_ext(ss, _xx, _yy, scx, scy, rot, cc, alp_draw);
|
||||
|
|
|
@ -33,7 +33,7 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
|||
|
||||
inputs[| 11] = nodeValue("Scale over time", self, JUNCTION_CONNECT.input, VALUE_TYPE.curve, CURVE_DEF_11 );
|
||||
|
||||
inputs[| 12] = nodeValue("Color over lifetime", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, [ new gradientKey(0, c_white) ] )
|
||||
inputs[| 12] = nodeValue("Color over lifetime", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, new gradientObject(c_white) )
|
||||
.setDisplay(VALUE_DISPLAY.gradient);
|
||||
|
||||
inputs[| 13] = nodeValue("Alpha", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1 ])
|
||||
|
@ -77,7 +77,7 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
|||
|
||||
inputs[| 27] = nodeValue("Spawn", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true);
|
||||
|
||||
inputs[| 28] = nodeValue("Random blend", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, [ new gradientKey(0, c_white) ] )
|
||||
inputs[| 28] = nodeValue("Random blend", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, new gradientObject(c_white) )
|
||||
.setDisplay(VALUE_DISPLAY.gradient);
|
||||
|
||||
inputs[| 29] = nodeValue("Directed from center", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false, "Make particle move away from the spawn center.");
|
||||
|
@ -151,7 +151,6 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
|||
|
||||
var _color = current_data[12];
|
||||
var _blend = current_data[28];
|
||||
var _bldTyp = inputs[| 28].getExtraData();
|
||||
var _alpha = current_data[13];
|
||||
var _fade = current_data[14];
|
||||
|
||||
|
@ -241,7 +240,7 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
|||
var _scy = random_range(_scale[2], _scale[3]) * _ss;
|
||||
|
||||
var _alp = random_range(_alpha[0], _alpha[1]);
|
||||
var _bld = gradient_eval(_blend, random(1), ds_list_get(_bldTyp, 0));
|
||||
var _bld = _blend.eval(random(1));
|
||||
|
||||
part.seed = irandom(99999);
|
||||
part.create(_spr, xx, yy, _lif);
|
||||
|
|
|
@ -30,7 +30,8 @@
|
|||
frame_progress = true;
|
||||
time_since_last_frame = 0;
|
||||
UPDATE = RENDER_TYPE.full;
|
||||
}
|
||||
} else
|
||||
frame_progress = false;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
|
|
@ -3,7 +3,6 @@ function buttonGradient(_onApply, dialog = noone) : widget() constructor {
|
|||
parentDialog = dialog;
|
||||
|
||||
current_gradient = noone;
|
||||
current_data = noone;
|
||||
|
||||
function apply(value) {
|
||||
if(!interactable) return;
|
||||
|
@ -12,7 +11,7 @@ function buttonGradient(_onApply, dialog = noone) : widget() constructor {
|
|||
|
||||
static trigger = function() {
|
||||
var dialog = dialogCall(o_dialog_gradient, WIN_W / 2, WIN_H / 2);
|
||||
dialog.setDefault(current_gradient, current_data);
|
||||
dialog.setDefault(current_gradient);
|
||||
dialog.onApply = apply;
|
||||
dialog.interactable = interactable;
|
||||
|
||||
|
@ -20,13 +19,12 @@ function buttonGradient(_onApply, dialog = noone) : widget() constructor {
|
|||
parentDialog.addChildren(dialog);
|
||||
}
|
||||
|
||||
static draw = function(_x, _y, _w, _h, _gradient, _data, _m) {
|
||||
static draw = function(_x, _y, _w, _h, _gradient, _m) {
|
||||
x = _x;
|
||||
y = _y;
|
||||
w = _w;
|
||||
h = _h;
|
||||
current_gradient = _gradient;
|
||||
current_data = _data;
|
||||
|
||||
var click = false;
|
||||
if(ihover && point_in_rectangle(_m[0], _m[1], _x, _y, _x + _w, _y + _h)) {
|
||||
|
@ -42,7 +40,7 @@ function buttonGradient(_onApply, dialog = noone) : widget() constructor {
|
|||
if(mouse_press(mb_left)) deactivate();
|
||||
}
|
||||
|
||||
draw_gradient(_x + ui(6), _y + ui(6), _w - ui(12), _h - ui(12), _gradient, _data[| 0]);
|
||||
_gradient.draw(_x + ui(6), _y + ui(6), _w - ui(12), _h - ui(12));
|
||||
|
||||
if(WIDGET_CURRENT == self)
|
||||
draw_sprite_stretched(THEME.widget_selecting, 0, _x - ui(3), _y - ui(3), _w + ui(6), _h + ui(6));
|
||||
|
|
|
@ -5,6 +5,10 @@ function colorFromRGBArray(arr) {
|
|||
return make_color_rgb(r, g, b);
|
||||
}
|
||||
|
||||
function color_get_alpha(color) {
|
||||
return (color & (0xFF << 24)) >> 24;
|
||||
}
|
||||
|
||||
function colorArrayFromReal(clr) {
|
||||
return [color_get_red(clr) / 255, color_get_green(clr) / 255, color_get_blue(clr) / 255 ];
|
||||
}
|
||||
|
@ -32,29 +36,29 @@ function colorMultiply(c1, c2) {
|
|||
return make_color_rgb((r1 * r2) / 255, (g1 * g2) / 255, (b1 * b2) / 255);
|
||||
}
|
||||
|
||||
function color_diff(c1, c2) {
|
||||
function color_diff(c1, c2, fast = false) {
|
||||
var _c1_r = c1 & 255;
|
||||
var _c1_g = (c1 >> 8) & 255;
|
||||
var _c1_g = (c1 >> 8) & 255;
|
||||
var _c1_b = (c1 >> 16) & 255;
|
||||
var _c1_a = (c1 >> 24) & 255;
|
||||
|
||||
_c1_r = _c1_r / 255;
|
||||
_c1_g = _c1_g / 255;
|
||||
_c1_b = _c1_b / 255;
|
||||
_c1_a = _c1_a / 255;
|
||||
_c1_r = _c1_r / 255 * _c1_a;
|
||||
_c1_g = _c1_g / 255 * _c1_a;
|
||||
_c1_b = _c1_b / 255 * _c1_a;
|
||||
|
||||
var _c2_r = c2 & 255;
|
||||
var _c2_g = (c2 >> 8) & 255;
|
||||
var _c2_g = (c2 >> 8) & 255;
|
||||
var _c2_b = (c2 >> 16) & 255;
|
||||
var _c2_a = (c2 >> 24) & 255;
|
||||
|
||||
_c2_r = _c2_r / 255;
|
||||
_c2_g = _c2_g / 255;
|
||||
_c2_b = _c2_b / 255;
|
||||
_c2_a = _c2_a / 255;
|
||||
_c2_r = _c2_r / 255 * _c2_a;
|
||||
_c2_g = _c2_g / 255 * _c2_a;
|
||||
_c2_b = _c2_b / 255 * _c2_a;
|
||||
|
||||
var dist = sqrt(sqr(_c1_r - _c2_r) + sqr(_c1_g - _c2_g) + sqr(_c1_b - _c2_b) + sqr(_c1_a - _c2_a));
|
||||
return dist;
|
||||
if(fast) return sqr(_c1_r - _c2_r) + sqr(_c1_g - _c2_g) + sqr(_c1_b - _c2_b) + sqr(_c1_a - _c2_a);
|
||||
return sqrt(sqr(_c1_r - _c2_r) + sqr(_c1_g - _c2_g) + sqr(_c1_b - _c2_b) + sqr(_c1_a - _c2_a));
|
||||
}
|
||||
|
||||
#region sorting functions
|
||||
|
|
|
@ -142,22 +142,24 @@ function colorSelector(onApply = noone) constructor {
|
|||
var h = shader_get_uniform(sh_color_picker_hue, "hue");
|
||||
shader_set_uniform_f(h, hue / 256);
|
||||
|
||||
draw_surface_safe(color_surface, col_x, col_y);
|
||||
draw_surface_ext_safe(color_surface, col_x, col_y,,,,, interactable * 0.5 + 0.5);
|
||||
shader_reset();
|
||||
} else if(disp_mode == 1) {
|
||||
shader_set(sh_color_picker_value);
|
||||
var v = shader_get_uniform(sh_color_picker_value, "value");
|
||||
shader_set_uniform_f(v, val / 256);
|
||||
|
||||
draw_surface_safe(color_surface, col_x, col_y);
|
||||
draw_surface_ext_safe(color_surface, col_x, col_y,,,,, interactable * 0.5 + 0.5);
|
||||
shader_reset();
|
||||
}
|
||||
shader_reset();
|
||||
|
||||
#region hue
|
||||
#region side control
|
||||
var hue_x = col_x + ui(280);
|
||||
var hue_y = col_y;
|
||||
|
||||
draw_sprite_stretched(THEME.ui_panel_bg, 0, hue_x - ui(8), hue_y - ui(8), ui(32), ui(256 + 16));
|
||||
|
||||
draw_set_alpha(interactable * 0.9 + 0.1);
|
||||
for(var i = 0; i < 256; i++) {
|
||||
if(disp_mode == 0)
|
||||
draw_set_color(make_color_hsv(i, 255, 255));
|
||||
|
@ -165,7 +167,8 @@ function colorSelector(onApply = noone) constructor {
|
|||
draw_set_color(make_color_hsv(hue, 255, 255 - i));
|
||||
draw_rectangle(hue_x, hue_y + ui(i), hue_x + ui(16), hue_y + ui(i + 1), false);
|
||||
}
|
||||
|
||||
draw_set_alpha(1);
|
||||
|
||||
if(disp_mode == 0) {
|
||||
var hy = hue_y + ui(hue);
|
||||
draw_sprite_stretched_ext(s_ui_base_white, 0, hue_x - ui(3), hy - ui(6), ui(24), ui(10), make_color_hsv(hue, 255, 255), 1);
|
||||
|
|
|
@ -4,9 +4,11 @@ function curveBox(_onModify) : widget() constructor {
|
|||
curve_surface = surface_create(1, 1);
|
||||
node_dragging = -1;
|
||||
node_drag_typ = -1;
|
||||
miny = 0;
|
||||
maxy = 1;
|
||||
|
||||
static get_x = function(val, _x, _w) { return _x + _w * clamp( val, 0, 1); }
|
||||
static get_y = function(val, _y, _h) { return _y + _h * clamp(1 - val, 0, 1); }
|
||||
static get_x = function(val, _x, _w) { return _x + _w * val; }
|
||||
static get_y = function(val, _y, _h) { return _y + _h * (1 - (val - miny) / (maxy - miny)); }
|
||||
|
||||
static register = function() {}
|
||||
|
||||
|
@ -17,8 +19,6 @@ function curveBox(_onModify) : widget() constructor {
|
|||
curve_surface = surface_verify(curve_surface, _w, _h);
|
||||
|
||||
var points = array_length(_data) / 6;
|
||||
draw_set_color(COLORS.widget_curve_outline);
|
||||
draw_rectangle(_x, _y, _x + _w, _y + _h, true);
|
||||
|
||||
if(node_dragging != -1) {
|
||||
if(node_drag_typ == 0) {
|
||||
|
@ -36,7 +36,7 @@ function curveBox(_onModify) : widget() constructor {
|
|||
}
|
||||
|
||||
var _my = 1 - (_m[1] - _y) / _h;
|
||||
_my = clamp(_my, 0, 1);
|
||||
_my = clamp(_my * (maxy - miny) + miny, 0, 1);
|
||||
_data[node_dragging + 1] = _my;
|
||||
|
||||
//sort by x
|
||||
|
@ -78,9 +78,9 @@ function curveBox(_onModify) : widget() constructor {
|
|||
_data[node_dragging + 2] = (_mx - _px) * node_drag_typ;
|
||||
|
||||
var _my = 1 - (_m[1] - _y) / _h;
|
||||
_my = clamp(_my, 0, 1);
|
||||
_data[node_dragging - 1] = (_py - _my) * node_drag_typ;
|
||||
_data[node_dragging + 3] = (_my - _py) * node_drag_typ;
|
||||
_my = _my * (maxy - miny) + miny;
|
||||
_data[node_dragging - 1] = clamp(_py - _my, -1, 1) * node_drag_typ;
|
||||
_data[node_dragging + 3] = clamp(_my - _py, -1, 1) * node_drag_typ;
|
||||
|
||||
if(onModify(_data))
|
||||
UNDO_HOLDING = true;
|
||||
|
@ -99,93 +99,129 @@ function curveBox(_onModify) : widget() constructor {
|
|||
var point_insert = 1;
|
||||
var _x1 = 0;
|
||||
|
||||
for( var i = 0; i < points; i++ ) {
|
||||
var ind = i * 6;
|
||||
var _x0 = _data[ind + 2];
|
||||
var _y0 = _data[ind + 3];
|
||||
var bx0 = _x0 + _data[ind + 0];
|
||||
var by0 = _y0 + _data[ind + 1];
|
||||
var ax0 = _x0 + _data[ind + 4];
|
||||
var ay0 = _y0 + _data[ind + 5];
|
||||
|
||||
bx0 = get_x(bx0, _x, _w);
|
||||
by0 = get_y(by0, _y, _h);
|
||||
_x0 = get_x(_x0, _x, _w);
|
||||
_y0 = get_y(_y0, _y, _h);
|
||||
ax0 = get_x(ax0, _x, _w);
|
||||
ay0 = get_y(ay0, _y, _h);
|
||||
|
||||
var msx = _m[0] - _x;
|
||||
var msy = _m[1] - _y;
|
||||
|
||||
surface_set_target(curve_surface);
|
||||
draw_clear_alpha(0, 0);
|
||||
draw_set_color(COLORS.widget_curve_line);
|
||||
if(i > 0) { //draw pre line
|
||||
draw_line(bx0, by0, _x0, _y0);
|
||||
|
||||
draw_circle(bx0, by0, 3, false);
|
||||
if(hover && point_in_circle(_m[0], _m[1], bx0, by0, 10)) {
|
||||
draw_circle(bx0, by0, 5, false);
|
||||
node_hovering = ind + 2;
|
||||
node_hover_typ = -1;
|
||||
}
|
||||
}
|
||||
draw_set_alpha(0.75);
|
||||
var y0 = _h - _h * (0 - miny) / (maxy - miny);
|
||||
draw_line(0, y0, _w, y0);
|
||||
var y1 = _h - _h * (1 - miny) / (maxy - miny);
|
||||
draw_line(0, y1, _w, y1);
|
||||
draw_set_alpha(1);
|
||||
|
||||
for( var i = 0; i < points; i++ ) {
|
||||
var ind = i * 6;
|
||||
var _x0 = _data[ind + 2];
|
||||
var _y0 = _data[ind + 3];
|
||||
var bx0 = _x0 + _data[ind + 0];
|
||||
var by0 = _y0 + _data[ind + 1];
|
||||
var ax0 = _x0 + _data[ind + 4];
|
||||
var ay0 = _y0 + _data[ind + 5];
|
||||
|
||||
if(i < points - 1) { //draw post line
|
||||
draw_line(ax0, ay0, _x0, _y0);
|
||||
bx0 = get_x(bx0, 0, _w);
|
||||
by0 = get_y(by0, 0, _h);
|
||||
_x0 = get_x(_x0, 0, _w);
|
||||
_y0 = get_y(_y0, 0, _h);
|
||||
ax0 = get_x(ax0, 0, _w);
|
||||
ay0 = get_y(ay0, 0, _h);
|
||||
|
||||
draw_circle(ax0, ay0, 3, false);
|
||||
if(hover && point_in_circle(_m[0], _m[1], ax0, ay0, 10)) {
|
||||
draw_circle(ax0, ay0, 5, false);
|
||||
node_hovering = ind + 2;
|
||||
node_hover_typ = 1;
|
||||
draw_set_color(COLORS.widget_curve_line);
|
||||
if(i > 0) { //draw pre line
|
||||
draw_line(bx0, by0, _x0, _y0);
|
||||
|
||||
draw_circle(bx0, by0, 3, false);
|
||||
if(hover && point_in_circle(msx, msy, bx0, by0, 10)) {
|
||||
draw_circle(bx0, by0, 5, false);
|
||||
node_hovering = ind + 2;
|
||||
node_hover_typ = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(i < points - 1) { //draw post line
|
||||
draw_line(ax0, ay0, _x0, _y0);
|
||||
|
||||
draw_circle(ax0, ay0, 3, false);
|
||||
if(hover && point_in_circle(msx, msy, ax0, ay0, 10)) {
|
||||
draw_circle(ax0, ay0, 5, false);
|
||||
node_hovering = ind + 2;
|
||||
node_hover_typ = 1;
|
||||
}
|
||||
}
|
||||
|
||||
draw_set_color(COLORS._main_accent);
|
||||
draw_circle(_x0, _y0, 3, false);
|
||||
if(hover && point_in_circle(msx, msy, _x0, _y0, 10)) {
|
||||
draw_circle(_x0, _y0, 5, false);
|
||||
node_hovering = ind + 2;
|
||||
node_hover_typ = 0;
|
||||
}
|
||||
|
||||
if(msx >= _x1 && msy <= _x0)
|
||||
point_insert = i;
|
||||
_x1 = _x0;
|
||||
}
|
||||
|
||||
draw_set_color(COLORS._main_accent);
|
||||
draw_circle(_x0, _y0, 3, false);
|
||||
if(hover && point_in_circle(_m[0], _m[1], _x0, _y0, 10)) {
|
||||
draw_circle(_x0, _y0, 5, false);
|
||||
node_hovering = ind + 2;
|
||||
node_hover_typ = 0;
|
||||
}
|
||||
|
||||
if(_m[0] >= _x1 && _m[0] <= _x0)
|
||||
point_insert = i;
|
||||
_x1 = _x0;
|
||||
draw_curve(0, 0, _w, -_h, _data, miny, maxy);
|
||||
|
||||
surface_reset_target();
|
||||
|
||||
var bx = _x + _w - ui(6 + 24);
|
||||
var by = _y + _h - ui(6 + 24);
|
||||
|
||||
if(buttonInstant(THEME.button_hide, bx, by, ui(24), ui(24), _m, active, hover,, THEME.add) == 2) {
|
||||
miny = 0;
|
||||
maxy = 1;
|
||||
}
|
||||
|
||||
bx -= ui(24 + 4);
|
||||
if(buttonInstant(THEME.button_hide, bx, by, ui(24), ui(24), _m, active, hover,, THEME.minus) == 2) {
|
||||
miny = -1;
|
||||
maxy = 2;
|
||||
}
|
||||
|
||||
draw_set_color(COLORS._main_accent);
|
||||
draw_curve(_x, _y, _w, -_h, _data);
|
||||
|
||||
if(hover && point_in_rectangle(_m[0], _m[1], _x - ui(5), _y - ui(5), _x + _w + ui(5), _y + _h + ui(5))) {
|
||||
if(mouse_press(mb_left, active)) {
|
||||
if(node_hovering == -1) {
|
||||
var _ind = point_insert * 6;
|
||||
var _px = (_m[0] - _x) / _w;
|
||||
var _py = 1 - (_m[1] - _y) / _h;
|
||||
if(hover) {
|
||||
if(point_in_rectangle(_m[0], _m[1], _x + _w - ui(6 + 24 * 2 + 4), _y + _h - ui(6 + 24), _x + _w + ui(5), _y + _h + ui(5))) {
|
||||
} else if(point_in_rectangle(msx, msy, -ui(5), -ui(5), _w + ui(5), _h + ui(5))) {
|
||||
if(mouse_press(mb_left, active)) {
|
||||
if(node_hovering == -1) {
|
||||
var _ind = point_insert * 6;
|
||||
var _px = (_m[0] - _x) / _w;
|
||||
var _py = 1 - (_m[1] - _y) / _h;
|
||||
|
||||
array_insert(_data, _ind + 0, -0.1);
|
||||
array_insert(_data, _ind + 1, 0);
|
||||
array_insert(_data, _ind + 2, _px);
|
||||
array_insert(_data, _ind + 3, _py);
|
||||
array_insert(_data, _ind + 4, 0.1);
|
||||
array_insert(_data, _ind + 5, 0);
|
||||
if(onModify(_data))
|
||||
UNDO_HOLDING = true;
|
||||
array_insert(_data, _ind + 0, -0.1);
|
||||
array_insert(_data, _ind + 1, 0);
|
||||
array_insert(_data, _ind + 2, _px);
|
||||
array_insert(_data, _ind + 3, _py);
|
||||
array_insert(_data, _ind + 4, 0.1);
|
||||
array_insert(_data, _ind + 5, 0);
|
||||
if(onModify(_data))
|
||||
UNDO_HOLDING = true;
|
||||
|
||||
node_dragging = _ind + 2;
|
||||
node_drag_typ = 0;
|
||||
} else {
|
||||
node_dragging = node_hovering;
|
||||
node_drag_typ = node_hover_typ;
|
||||
}
|
||||
} else if(mouse_press(mb_right, active)) {
|
||||
var node_point = (node_hovering - 2) / 6;
|
||||
if(node_hover_typ == 0 && node_point > 0 && node_point < points - 1) {
|
||||
array_delete(_data, node_point * 6, 6);
|
||||
if(onModify(_data))
|
||||
UNDO_HOLDING = true;
|
||||
node_dragging = _ind + 2;
|
||||
node_drag_typ = 0;
|
||||
} else {
|
||||
node_dragging = node_hovering;
|
||||
node_drag_typ = node_hover_typ;
|
||||
}
|
||||
} else if(mouse_press(mb_right, active)) {
|
||||
var node_point = (node_hovering - 2) / 6;
|
||||
if(node_hover_typ == 0 && node_point > 0 && node_point < points - 1) {
|
||||
array_delete(_data, node_point * 6, 6);
|
||||
if(onModify(_data))
|
||||
UNDO_HOLDING = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
draw_surface(curve_surface, _x, _y);
|
||||
draw_set_color(COLORS.widget_curve_outline);
|
||||
draw_rectangle(_x, _y, _x + _w, _y + _h, true);
|
||||
|
||||
resetFocus();
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
#macro CURVE_DEF_10 [0, 0, 0, 1, 1/3, -1/3, /**/ -1/3, 1/3, 1, 0, 0, 0]
|
||||
#macro CURVE_DEF_11 [0, 0, 0, 1, 1/3, 0, /**/ -1/3, 0, 1, 1, 0, 0]
|
||||
|
||||
function draw_curve(x0, y0, _w, _h, _bz) {
|
||||
function draw_curve(x0, y0, _w, _h, _bz, miny = 0, maxy = 1) {
|
||||
var segments = array_length(_bz) / 6 - 1;
|
||||
|
||||
for( var i = 0; i < segments; i++ ) {
|
||||
|
@ -28,17 +28,18 @@ function draw_curve(x0, y0, _w, _h, _bz) {
|
|||
var dw = dx1 - dx0;
|
||||
var smp = ceil((_x1 - _x0) * 32);
|
||||
|
||||
draw_curve_segment(dx0, y0, dw, _h, [_y0, ax0, ay0, bx1, by1, _y1], smp);
|
||||
draw_curve_segment(dx0, y0, dw, _h, [_y0, ax0, ay0, bx1, by1, _y1], smp, miny, maxy);
|
||||
}
|
||||
}
|
||||
|
||||
function draw_curve_segment(x0, y0, _w, _h, _bz, SAMPLE = 32) {
|
||||
function draw_curve_segment(x0, y0, _w, _h, _bz, SAMPLE = 32, miny = 0, maxy = 1) {
|
||||
var _ox, _oy;
|
||||
|
||||
for(var i = 0; i <= SAMPLE; i++) {
|
||||
var t = i / SAMPLE;
|
||||
var _r = eval_curve_segment_t_position(t, _bz);
|
||||
var _rx = _r[0], _ry = _r[1];
|
||||
_ry = (_ry - miny) / (maxy - miny);
|
||||
|
||||
var _nx = _rx * _w + x0;
|
||||
var _ny = (_h? _ry : 1 - _ry) * abs(_h) + y0;
|
||||
|
|
|
@ -48,6 +48,11 @@ function MenuItem(name, func, spr = noone, hotkey = noone) constructor {
|
|||
return self;
|
||||
}
|
||||
|
||||
static setActive = function(active) {
|
||||
self.active = active;
|
||||
return self;
|
||||
}
|
||||
|
||||
static deactivate = function() {
|
||||
active = false;
|
||||
return self;
|
||||
|
|
|
@ -35,12 +35,16 @@ function draw_line_curve(x0, y0, x1, y1, thick = 1) {
|
|||
//buffer_delete(buff);
|
||||
}
|
||||
|
||||
function draw_line_curve_color(x0, y0, x1, y1, thick, col1, col2, type = LINE_STYLE.solid) {
|
||||
var xc = (x0 + x1) / 2;
|
||||
function draw_line_curve_color(x0, y0, x1, y1, xc, yc, _s, thick, col1, col2, type = LINE_STYLE.solid) {
|
||||
var sample = ceil((abs(x0 - x1) + abs(y0 - y1)) / 16 * PREF_MAP[? "connection_line_sample"]);
|
||||
sample = clamp(sample, 8, 128);
|
||||
|
||||
var c = draw_get_color();
|
||||
var x2 = lerp(x0, x1, 0. - sign(x1 - x0) * 0.2) - abs(y1 - y0) * 0.1;
|
||||
var x3 = lerp(x0, x1, 1. + sign(x1 - x0) * 0.2) + abs(y1 - y0) * 0.1;
|
||||
var y2 = y0;
|
||||
var y3 = y1;
|
||||
|
||||
var c = draw_get_color();
|
||||
var ox, oy, nx, ny, t, it, oc, nc;
|
||||
var dash_distance = 2;
|
||||
|
||||
|
@ -48,8 +52,18 @@ function draw_line_curve_color(x0, y0, x1, y1, thick, col1, col2, type = LINE_ST
|
|||
t = i / sample;
|
||||
it = 1 - t;
|
||||
|
||||
nx = x0 * t * t * t + 3 * xc * it * t * t + 3 * xc * it * it * t + x1 * it * it * it;
|
||||
ny = y0 * t * t * t + 3 * y0 * it * t * t + 3 * y1 * it * it * t + y1 * it * it * it;
|
||||
nx = x0 * power(t, 4)
|
||||
+ 4 * x2 * power(it, 1) * power(t, 3)
|
||||
+ 6 * xc * power(it, 2) * power(t, 2)
|
||||
+ 4 * x3 * power(it, 3) * power(t, 1)
|
||||
+ x1 * power(it, 4);
|
||||
|
||||
ny = y0 * power(t, 4)
|
||||
+ 4 * y2 * power(it, 1) * power(t, 3)
|
||||
+ 6 * yc * power(it, 2) * power(t, 2)
|
||||
+ 4 * y3 * power(it, 3) * power(t, 1)
|
||||
+ y1 * power(it, 4);
|
||||
|
||||
nc = merge_color(col1, col2, t);
|
||||
|
||||
if(i) {
|
||||
|
@ -70,21 +84,34 @@ function draw_line_curve_color(x0, y0, x1, y1, thick, col1, col2, type = LINE_ST
|
|||
}
|
||||
}
|
||||
|
||||
function distance_to_curve(mx, my, x0, y0, x1, y1) {
|
||||
var xc = (x0 + x1) / 2;
|
||||
function distance_to_curve(mx, my, x0, y0, x1, y1, xc, yc, _s) {
|
||||
var sample = ceil((abs(x0 - x1) + abs(y0 - y1)) / 16 * PREF_MAP[? "connection_line_sample"]);
|
||||
sample = clamp(sample, 8, 128);
|
||||
|
||||
var dist = 999999;
|
||||
var ox, oy, nx, ny, t, it;
|
||||
|
||||
var x2 = lerp(x0, x1, 0. - sign(x1 - x0) * 0.2);
|
||||
var x3 = lerp(x0, x1, 1. + sign(x1 - x0) * 0.2);
|
||||
var y2 = y0;
|
||||
var y3 = y1;
|
||||
|
||||
for( var i = 0; i <= sample; i++ ) {
|
||||
t = i / sample;
|
||||
it = 1 - t;
|
||||
|
||||
nx = x0 * t * t * t + 3 * xc * it * t * t + 3 * xc * it * it * t + x1 * it * it * it;
|
||||
ny = y0 * t * t * t + 3 * y0 * it * t * t + 3 * y1 * it * it * t + y1 * it * it * it;
|
||||
|
||||
nx = x0 * power(t, 4)
|
||||
+ 4 * x2 * power(it, 1) * power(t, 3)
|
||||
+ 6 * xc * power(it, 2) * power(t, 2)
|
||||
+ 4 * x3 * power(it, 3) * power(t, 1)
|
||||
+ x1 * power(it, 4);
|
||||
|
||||
ny = y0 * power(t, 4)
|
||||
+ 4 * y2 * power(it, 1) * power(t, 3)
|
||||
+ 6 * yc * power(it, 2) * power(t, 2)
|
||||
+ 4 * y3 * power(it, 3) * power(t, 1)
|
||||
+ y1 * power(it, 4);
|
||||
|
||||
if(i)
|
||||
dist = min(dist, distance_to_line(mx, my, ox, oy, nx, ny));
|
||||
|
||||
|
@ -98,21 +125,23 @@ function distance_to_curve(mx, my, x0, y0, x1, y1) {
|
|||
function draw_line_elbow(x0, y0, x1, y1, thick = 1, type = LINE_STYLE.solid) {
|
||||
var cx = (x0 + x1) / 2;
|
||||
draw_line_width(x0, y0, cx, y0, thick);
|
||||
draw_line_width(cx, y0 - thick / 2, cx, y1 + thick / 2, thick);
|
||||
draw_line_width(cx, y0 - thick / 2 * sign(y1 - y0), cx, y1 + thick / 2 * sign(y1 - y0), thick);
|
||||
draw_line_width(cx, y1, x1, y1, thick);
|
||||
}
|
||||
|
||||
function draw_line_elbow_color(x0, y0, x1, y1, thick, col1, col2, type = LINE_STYLE.solid) {
|
||||
var cx = (x0 + x1) / 2;
|
||||
var cm = merge_color(col1, col2, 0.5);
|
||||
|
||||
function draw_line_elbow_color(x0, y0, x1, y1, cx, thick, col1, col2, type = LINE_STYLE.solid) {
|
||||
var _x0 = min(x0, x1);
|
||||
var _x1 = max(x0, x1);
|
||||
var rat = (cx - _x0) / (_x1 - _x0);
|
||||
var cm = merge_color(col1, col2, rat);
|
||||
|
||||
if(type == LINE_STYLE.solid) {
|
||||
draw_line_width_color(x0, y0, cx, y0, thick, col1, cm);
|
||||
draw_line_width_color(cx, y0 - thick / 2, cx, y1 + thick / 2, thick, cm, cm);
|
||||
draw_line_width_color(cx, y0 - thick / 2 * sign(y1 - y0), cx, y1 + thick / 2 * sign(y1 - y0), thick, cm, cm);
|
||||
draw_line_width_color(cx, y1, x1, y1, thick, cm, col2);
|
||||
} else {
|
||||
draw_line_dashed_color(x0, y0, cx, y0, thick, col1, cm, 12);
|
||||
draw_line_dashed_color(cx, y0 - thick / 2, cx, y1 + thick / 2, thick, cm, cm, 12);
|
||||
draw_line_dashed_color(cx, y0 - thick / 2 * sign(y1 - y0), cx, y1 + thick / 2 * sign(y1 - y0), thick, cm, cm, 12);
|
||||
draw_line_dashed_color(cx, y1, x1, y1, thick, cm, col2, 12);
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
function draw_line_dashed(x0, y0, x1, y1, th = 1, dash_distance = 8) {
|
||||
function draw_line_dashed(x0, y0, x1, y1, th = 1, dash_distance = 8, dash_shift = 0) {
|
||||
var dis = point_distance(x0, y0, x1, y1);
|
||||
var dir = point_direction(x0, y0, x1, y1);
|
||||
var part = ceil(dis / dash_distance);
|
||||
|
@ -6,19 +6,20 @@ function draw_line_dashed(x0, y0, x1, y1, th = 1, dash_distance = 8) {
|
|||
var dx = lengthdir_x(1, dir);
|
||||
var dy = lengthdir_y(1, dir);
|
||||
|
||||
var ox, oy, nx, ny;
|
||||
var dd = 0;
|
||||
var ox, oy, nx, ny, od, nd;
|
||||
var rat = dash_distance / dis;
|
||||
|
||||
for( var i = 0; i <= part; i++ ) {
|
||||
dd = min(dis, i * dash_distance);
|
||||
nx = x0 + dx * dd;
|
||||
ny = y0 + dy * dd;
|
||||
nd = dis * frac(i * rat + dash_shift / dis);
|
||||
nx = x0 + dx * nd;
|
||||
ny = y0 + dy * nd;
|
||||
|
||||
if(i && i % 2)
|
||||
if(i && i % 2 && nd > od)
|
||||
draw_line_width(ox, oy, nx, ny, th);
|
||||
|
||||
ox = nx;
|
||||
oy = ny;
|
||||
od = nd;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -18,6 +18,11 @@ function draw_tooltip_color(clr) {
|
|||
return;
|
||||
}
|
||||
|
||||
if(is_string(clr)) {
|
||||
draw_tooltip_gradient(clr);
|
||||
return;
|
||||
}
|
||||
|
||||
var ww = ui(32);
|
||||
var hh = ui(32);
|
||||
|
||||
|
@ -44,6 +49,19 @@ function draw_tooltip_palette(clr) {
|
|||
drawPalette(clr, mx + ui(8), my + ui(8), ui(ww), ui(hh));
|
||||
}
|
||||
|
||||
function draw_tooltip_gradient(clr) {
|
||||
var ww = min(ui(160), ui(32) * array_length(clr));
|
||||
var hh = ui(32);
|
||||
|
||||
var mx = min(mouse_mx + ui(16), WIN_W - (ww + ui(16)));
|
||||
var my = min(mouse_my + ui(16), WIN_H - (hh + ui(16)));
|
||||
|
||||
draw_sprite_stretched(THEME.textbox, 3, mx, my, ww + ui(16), hh + ui(16));
|
||||
draw_sprite_stretched(THEME.textbox, 0, mx, my, ww + ui(16), hh + ui(16));
|
||||
|
||||
clr.draw(mx + ui(8), my + ui(8), ui(ww), ui(hh));
|
||||
}
|
||||
|
||||
function draw_tooltip_surface_array(surf) {
|
||||
var amo = array_length(surf);
|
||||
var col = ceil(sqrt(amo));
|
||||
|
|
|
@ -28,9 +28,9 @@
|
|||
COLOR_KEYS = [];
|
||||
|
||||
globalvar VERSION, SAVEFILE_VERSION, VERSION_STRING;
|
||||
VERSION = 1134;
|
||||
SAVEFILE_VERSION = 1330;
|
||||
VERSION_STRING = "1.13.4";
|
||||
VERSION = 1135;
|
||||
SAVEFILE_VERSION = 1350;
|
||||
VERSION_STRING = "1.13.5";
|
||||
|
||||
globalvar NODES, NODE_MAP, APPEND_MAP, HOTKEYS, HOTKEY_CONTEXT, NODE_INSTANCES;
|
||||
|
||||
|
|
|
@ -18,102 +18,134 @@ function gradientKey(time, value) constructor {
|
|||
}
|
||||
}
|
||||
|
||||
function draw_gradient(_x, _y, _w, _h, _grad, _int = GRADIENT_INTER.smooth) {
|
||||
static RES = 48;
|
||||
var _step = _w / RES;
|
||||
var _ox, _oc;
|
||||
function gradientObject(color = c_black) constructor {
|
||||
if(is_array(color))
|
||||
keys = [ new gradientKey(0, color[0]), new gradientKey(1, color[1]) ];
|
||||
else
|
||||
keys = [ new gradientKey(0, color) ];
|
||||
type = GRADIENT_INTER.smooth;
|
||||
|
||||
var uniform_grad_blend = shader_get_uniform(sh_gradient_display, "gradient_blend");
|
||||
var uniform_grad = shader_get_uniform(sh_gradient_display, "gradient_color");
|
||||
var uniform_grad_time = shader_get_uniform(sh_gradient_display, "gradient_time");
|
||||
var uniform_grad_key = shader_get_uniform(sh_gradient_display, "gradient_keys");
|
||||
|
||||
var _grad_color = [];
|
||||
var _grad_time = [];
|
||||
|
||||
for(var i = 0; i < array_length(_grad); i++) {
|
||||
if(_grad[i].value == undefined) return;
|
||||
static clone = function() {
|
||||
var g = new gradientObject();
|
||||
for( var i = 0; i < array_length(keys); i++ ) {
|
||||
g.keys[i] = keys[i].clone();
|
||||
}
|
||||
g.type = type;
|
||||
|
||||
_grad_color[i * 4 + 0] = color_get_red(_grad[i].value) / 255;
|
||||
_grad_color[i * 4 + 1] = color_get_green(_grad[i].value) / 255;
|
||||
_grad_color[i * 4 + 2] = color_get_blue(_grad[i].value) / 255;
|
||||
_grad_color[i * 4 + 3] = 1;
|
||||
_grad_time[i] = _grad[i].time;
|
||||
return g;
|
||||
}
|
||||
|
||||
if(array_length(_grad) == 0) {
|
||||
draw_sprite_stretched(s_fx_pixel, 0, _x, _y, _w, _h)
|
||||
} else {
|
||||
shader_set(sh_gradient_display);
|
||||
shader_set_uniform_i(uniform_grad_blend, _int);
|
||||
shader_set_uniform_f_array_safe(uniform_grad, _grad_color);
|
||||
shader_set_uniform_f_array_safe(uniform_grad_time, _grad_time);
|
||||
shader_set_uniform_i(uniform_grad_key, array_length(_grad));
|
||||
static add = function(_addkey, _deleteDup = true) {
|
||||
if(array_length(keys) == 0) {
|
||||
array_push(keys, _addkey);
|
||||
return;
|
||||
}
|
||||
|
||||
for(var i = 0; i < array_length(keys); i++) {
|
||||
var _key = keys[i];
|
||||
|
||||
if(_key.time == _addkey.time) {
|
||||
if(_deleteDup)
|
||||
_key.value = _addkey.value;
|
||||
return;
|
||||
} else if(_key.time > _addkey.time) {
|
||||
array_insert(keys, i, _addkey);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
array_push(keys, _addkey);
|
||||
}
|
||||
|
||||
static eval = function(position) {
|
||||
if(array_length(keys) == 0) return c_black;
|
||||
if(array_length(keys) == 1) return keys[0].value;
|
||||
|
||||
for(var i = 0; i < array_length(keys); i++) {
|
||||
var _key = keys[i];
|
||||
if(_key.time < position) continue;
|
||||
if(_key.time == position) return keys[i].value;
|
||||
|
||||
if(i == 0) //before first color
|
||||
return keys[0].value;
|
||||
|
||||
var c0 = keys[i - 1].value;
|
||||
if(type == GRADIENT_INTER.smooth) {
|
||||
var rat = (position - keys[i - 1].time) / (keys[i].time - keys[i - 1].time);
|
||||
var c1 = keys[i].value;
|
||||
return merge_color(c0, c1, rat);
|
||||
} else if(type == GRADIENT_INTER.none) {
|
||||
return c0;
|
||||
}
|
||||
}
|
||||
|
||||
return keys[array_length(keys) - 1].value; //after last color
|
||||
}
|
||||
|
||||
static draw = function(_x, _y, _w, _h) {
|
||||
static RES = 48;
|
||||
var _step = _w / RES;
|
||||
var _ox, _oc;
|
||||
|
||||
var uniform_grad_blend = shader_get_uniform(sh_gradient_display, "gradient_blend");
|
||||
var uniform_grad = shader_get_uniform(sh_gradient_display, "gradient_color");
|
||||
var uniform_grad_time = shader_get_uniform(sh_gradient_display, "gradient_time");
|
||||
var uniform_grad_key = shader_get_uniform(sh_gradient_display, "gradient_keys");
|
||||
|
||||
var _grad_color = [];
|
||||
var _grad_time = [];
|
||||
|
||||
for(var i = 0; i < array_length(keys); i++) {
|
||||
if(keys[i].value == undefined) return;
|
||||
|
||||
_grad_color[i * 4 + 0] = color_get_red(keys[i].value) / 255;
|
||||
_grad_color[i * 4 + 1] = color_get_green(keys[i].value) / 255;
|
||||
_grad_color[i * 4 + 2] = color_get_blue(keys[i].value) / 255;
|
||||
_grad_color[i * 4 + 3] = 1;
|
||||
_grad_time[i] = keys[i].time;
|
||||
}
|
||||
|
||||
if(array_length(keys) == 0) {
|
||||
draw_sprite_stretched(s_fx_pixel, 0, _x, _y, _w, _h)
|
||||
} else {
|
||||
shader_set(sh_gradient_display);
|
||||
shader_set_uniform_i(uniform_grad_blend, type);
|
||||
shader_set_uniform_f_array_safe(uniform_grad, _grad_color);
|
||||
shader_set_uniform_f_array_safe(uniform_grad_time, _grad_time);
|
||||
shader_set_uniform_i(uniform_grad_key, array_length(keys));
|
||||
|
||||
draw_sprite_stretched(s_fx_pixel, 0, _x, _y, _w, _h)
|
||||
shader_reset();
|
||||
}
|
||||
}
|
||||
|
||||
function gradient_eval(_gradient, _time, _int = GRADIENT_INTER.smooth) {
|
||||
if(array_length(_gradient) == 0) return c_white;
|
||||
if(array_length(_gradient) == 1) return _gradient[0].value;
|
||||
|
||||
for(var i = 0; i < array_length(_gradient); i++) {
|
||||
var _key = _gradient[i];
|
||||
if(_key.time < _time) continue;
|
||||
if(_key.time == _time) return _gradient[i].value;
|
||||
|
||||
if(i == 0) //before first color
|
||||
return _gradient[0].value;
|
||||
|
||||
var c0 = _gradient[i - 1].value;
|
||||
if(_int == GRADIENT_INTER.smooth) {
|
||||
var rat = (_time - _gradient[i - 1].time) / (_gradient[i].time - _gradient[i - 1].time);
|
||||
var c1 = _gradient[i].value;
|
||||
return merge_color(c0, c1, rat);
|
||||
} else if(_int == GRADIENT_INTER.none) {
|
||||
return c0;
|
||||
draw_sprite_stretched(s_fx_pixel, 0, _x, _y, _w, _h)
|
||||
shader_reset();
|
||||
}
|
||||
}
|
||||
|
||||
return _gradient[array_length(_gradient) - 1].value; //after last color
|
||||
}
|
||||
|
||||
function gradient_add(_gradient, _addkey, _deleteDup) {
|
||||
if(array_length(_gradient) == 0) {
|
||||
array_push(_gradient, _addkey);
|
||||
return;
|
||||
}
|
||||
static toArray = function() {
|
||||
var _grad_color = [], _grad_time = [];
|
||||
|
||||
for(var i = 0; i < array_length(keys); i++) {
|
||||
if(is_undefined(keys[i].value)) continue;
|
||||
|
||||
for(var i = 0; i < array_length(_gradient); i++) {
|
||||
var _key = _gradient[i];
|
||||
|
||||
if(_key.time == _addkey.time) {
|
||||
if(_deleteDup)
|
||||
_key.value = _addkey.value;
|
||||
return;
|
||||
} else if(_key.time > _addkey.time) {
|
||||
array_insert(_gradient, i, _addkey);
|
||||
return;
|
||||
_grad_color[i * 4 + 0] = color_get_red(keys[i].value) / 255;
|
||||
_grad_color[i * 4 + 1] = color_get_green(keys[i].value) / 255;
|
||||
_grad_color[i * 4 + 2] = color_get_blue(keys[i].value) / 255;
|
||||
_grad_color[i * 4 + 3] = 1;
|
||||
_grad_time[i] = keys[i].time;
|
||||
}
|
||||
}
|
||||
|
||||
array_push(_gradient, _addkey);
|
||||
}
|
||||
|
||||
function gradient_to_array(_gradient) {
|
||||
var _grad_color = [], _grad_time = [];
|
||||
|
||||
for(var i = 0; i < array_length(_gradient); i++) {
|
||||
if(is_undefined(_gradient[i].value)) continue;
|
||||
|
||||
_grad_color[i * 4 + 0] = color_get_red(_gradient[i].value) / 255;
|
||||
_grad_color[i * 4 + 1] = color_get_green(_gradient[i].value) / 255;
|
||||
_grad_color[i * 4 + 2] = color_get_blue(_gradient[i].value) / 255;
|
||||
_grad_color[i * 4 + 3] = 1;
|
||||
_grad_time[i] = _gradient[i].time;
|
||||
return [ _grad_color, _grad_time ];
|
||||
}
|
||||
|
||||
return [ _grad_color, _grad_time ];
|
||||
static serialize = function() {
|
||||
return json_stringify(self);
|
||||
}
|
||||
|
||||
static deserialize = function(str) {
|
||||
var s = json_parse(str);
|
||||
type = s.type;
|
||||
keys = [];
|
||||
for( var i = 0; i < array_length(s.keys); i++ )
|
||||
keys[i] = new gradientKey(s.keys[i].time, s.keys[i].value);
|
||||
|
||||
return self;
|
||||
}
|
||||
}
|
|
@ -156,16 +156,7 @@ function __LOAD_PATH(path, readonly = false, safe_mode = false) {
|
|||
log_warning("LOAD, update", exception_print(e));
|
||||
}
|
||||
|
||||
try {
|
||||
for(var i = 0; i < ds_list_size(create_list); i++) {
|
||||
if(create_list[| i].hasInspectorUpdate())
|
||||
create_list[| i].inspectorUpdate();
|
||||
}
|
||||
} catch(e) {
|
||||
log_warning("LOAD, update", exception_print(e));
|
||||
}
|
||||
|
||||
Render();
|
||||
Render(, true);
|
||||
|
||||
if(!ds_queue_empty(CONNECTION_CONFLICT)) {
|
||||
var pass = 0;
|
||||
|
|
|
@ -13,7 +13,7 @@ function loadPalette(path) {
|
|||
var _r = string_hexadecimal(string_copy(_w, 1, 2));
|
||||
var _g = string_hexadecimal(string_copy(_w, 3, 2));
|
||||
var _b = string_hexadecimal(string_copy(_w, 5, 2));
|
||||
|
||||
|
||||
pal[_index++] = make_color_rgb(_r, _g, _b);
|
||||
break;
|
||||
case ".gpl" :
|
||||
|
|
|
@ -171,6 +171,10 @@ function Node_Array(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
|||
createNewInput();
|
||||
}
|
||||
|
||||
static doApplyDeserialize = function() {
|
||||
onValueUpdate(0);
|
||||
}
|
||||
|
||||
static attributeSerialize = function() {
|
||||
var att = ds_map_create();
|
||||
ds_map_override(att, attributes);
|
||||
|
@ -179,10 +183,5 @@ function Node_Array(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
|||
|
||||
static attributeDeserialize = function(attr) {
|
||||
ds_map_override(attributes, attr);
|
||||
|
||||
var amo = ds_map_find_value(attributes, "size");
|
||||
//var _add = amo - (ds_list_size(inputs) - input_fix_len);
|
||||
//repeat(_add)
|
||||
// createNewInput();
|
||||
}
|
||||
}
|
|
@ -190,7 +190,7 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
|||
|
||||
for( var j = 0; j < ds_list_size(outputs[| 1].value_to); j++ ) {
|
||||
var _targNode = outputs[| 1].value_to[| j].node;
|
||||
if(_targNode.name == _name) {
|
||||
if(_targNode.display_name == _name) {
|
||||
_node = _targNode;
|
||||
break;
|
||||
}
|
||||
|
@ -201,7 +201,7 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
|||
|
||||
lvs[i] = _node;
|
||||
lvs[i].inputs[| 0].setFrom(outputs[| 1]);
|
||||
lvs[i].name = _name;
|
||||
lvs[i].display_name = _name;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ function Node_ASE_layer(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
|||
layer_object = noone;
|
||||
|
||||
for( var i = 0; i < array_length(data.layers); i++ ) {
|
||||
if(data.layers[i].name != name) continue;
|
||||
if(data.layers[i].name != display_name) continue;
|
||||
|
||||
layer_object = data.layers[i];
|
||||
break;
|
||||
|
@ -39,8 +39,8 @@ function Node_ASE_layer(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
|||
var data = inputs[| 0].getValue();
|
||||
if(data == noone) return;
|
||||
|
||||
if(_name != name) {
|
||||
_name = name;
|
||||
if(_name != display_name) {
|
||||
_name = display_name;
|
||||
findLayer();
|
||||
}
|
||||
|
||||
|
|
53
scripts/node_cache/node_cache.gml
Normal file
53
scripts/node_cache/node_cache.gml
Normal file
|
@ -0,0 +1,53 @@
|
|||
function Node_Cache(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||
name = "Cache";
|
||||
use_cache = true;
|
||||
|
||||
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
|
||||
outputs[| 0] = nodeValue("Cache surface", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, 0);
|
||||
|
||||
input_display_list = [
|
||||
["Surface", true], 0,
|
||||
];
|
||||
|
||||
cache_loading = false;
|
||||
cache_content = "";
|
||||
cache_loading_progress = 0;
|
||||
|
||||
static step = function() {
|
||||
if(cache_loading) {
|
||||
cached_output[cache_loading_progress] = surface_array_deserialize(cache_content, cache_loading_progress);
|
||||
cache_result[cache_loading_progress] = true;
|
||||
cache_loading_progress++;
|
||||
|
||||
if(cache_loading_progress == ANIMATOR.frames_total) {
|
||||
cache_loading = false;
|
||||
update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static update = function() {
|
||||
if(recoverCache() || !ANIMATOR.is_playing) return;
|
||||
if(!inputs[| 0].value_from) return;
|
||||
|
||||
var _surf = inputs[| 0].getValue();
|
||||
cacheCurrentFrame(_surf);
|
||||
}
|
||||
|
||||
function onDrawNode(xx, yy, _mx, _my, _s) {
|
||||
if(cache_loading)
|
||||
draw_sprite_ui(THEME.loading, 0, xx + w * _s / 2, yy + h * _s / 2, _s, _s, current_time / 2, COLORS._main_icon, 1);
|
||||
}
|
||||
|
||||
static doSerialize = function(_map) {
|
||||
_map[? "cache"] = surface_array_serialize(cached_output);
|
||||
}
|
||||
|
||||
static postDeserialize = function() {
|
||||
if(!ds_map_exists(load_map, "cache")) return;
|
||||
cache_content = load_map[? "cache"];
|
||||
cache_loading_progress = 0;
|
||||
cache_loading = true;
|
||||
}
|
||||
}
|
11
scripts/node_cache/node_cache.yy
Normal file
11
scripts/node_cache/node_cache.yy
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"resourceType": "GMScript",
|
||||
"resourceVersion": "1.0",
|
||||
"name": "node_cache",
|
||||
"isCompatibility": false,
|
||||
"isDnD": false,
|
||||
"parent": {
|
||||
"name": "node",
|
||||
"path": "folders/nodes/data/node.yy",
|
||||
},
|
||||
}
|
12
scripts/node_cache/node_outline.yy
Normal file
12
scripts/node_cache/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",
|
||||
}
|
|
@ -7,15 +7,49 @@ function Node_Cache_Array(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
outputs[| 0] = nodeValue("Cache array", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, []);
|
||||
|
||||
input_display_list = [
|
||||
["Surface", true], 0,
|
||||
["Surface", true], 0,
|
||||
];
|
||||
|
||||
cache_loading = false;
|
||||
cache_content = "";
|
||||
cache_loading_progress = 0;
|
||||
|
||||
static step = function() {
|
||||
if(cache_loading) {
|
||||
cached_output[cache_loading_progress] = surface_array_deserialize(cache_content, cache_loading_progress);
|
||||
cache_result[cache_loading_progress] = true;
|
||||
cache_loading_progress++;
|
||||
|
||||
if(cache_loading_progress == ANIMATOR.frames_total) {
|
||||
cache_loading = false;
|
||||
update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static update = function() {
|
||||
if(!inputs[| 0].value_from) return;
|
||||
outputs[| 0].setValue(cached_output);
|
||||
|
||||
if(!ANIMATOR.is_playing) return;
|
||||
if(!inputs[| 0].value_from) return;
|
||||
|
||||
var _surf = inputs[| 0].getValue();
|
||||
cacheCurrentFrame(_surf);
|
||||
outputs[| 0].setValue(cached_output);
|
||||
}
|
||||
|
||||
function onDrawNode(xx, yy, _mx, _my, _s) {
|
||||
if(cache_loading)
|
||||
draw_sprite_ui(THEME.loading, 0, xx + w * _s / 2, yy + h * _s / 2, _s, _s, current_time / 2, COLORS._main_icon, 1);
|
||||
}
|
||||
|
||||
static doSerialize = function(_map) {
|
||||
_map[? "cache"] = surface_array_serialize(cached_output);
|
||||
}
|
||||
|
||||
static postDeserialize = function() {
|
||||
if(!ds_map_exists(load_map, "cache")) return;
|
||||
cache_content = load_map[? "cache"];
|
||||
cache_loading_progress = 0;
|
||||
cache_loading = true;
|
||||
}
|
||||
}
|
|
@ -133,7 +133,7 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
var _sw = surface_get_width(_brush);
|
||||
var _sh = surface_get_height(_brush);
|
||||
|
||||
draw_surface_ext(_brush, _x - _sw / 2, _y - _sh / 2, 1, 1, 0, draw_get_color(), 1);
|
||||
draw_surface_ext(_brush, _x - floor(_sw / 2), _y - floor(_sh / 2), 1, 1, 0, draw_get_color(), 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -245,7 +245,7 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
}
|
||||
|
||||
function ff_fillable(colorBase, colorFill, _x, _y, _thres) {
|
||||
var d = color_diff(colorBase, get_color_buffer(_x, _y));
|
||||
var d = color_diff(colorBase, get_color_buffer(_x, _y), true);
|
||||
return d <= _thres && d != colorFill;
|
||||
}
|
||||
|
||||
|
@ -259,6 +259,7 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
|
||||
var x1, y1, x_start;
|
||||
var spanAbove, spanBelow;
|
||||
var thr = _thres * _thres;
|
||||
|
||||
var queue = ds_queue_create();
|
||||
ds_queue_enqueue(queue, [_x, _y]);
|
||||
|
@ -273,7 +274,7 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
|
||||
if(colorCurr == colorFill) continue; //Color in queue already filled
|
||||
|
||||
while(x1 >= 0 && ff_fillable(colorBase, colorFill, x1, y1, _thres)) //Shift left
|
||||
while(x1 >= 0 && ff_fillable(colorBase, colorFill, x1, y1, thr)) //Shift left
|
||||
x1--;
|
||||
|
||||
x1++;
|
||||
|
@ -282,7 +283,7 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
spanAbove = false;
|
||||
spanBelow = false;
|
||||
|
||||
while(x1 < surface_w && ff_fillable(colorBase, colorFill, x1, y1, _thres)) {
|
||||
while(x1 < surface_w && ff_fillable(colorBase, colorFill, x1, y1, thr)) {
|
||||
draw_point(x1, y1);
|
||||
buffer_seek(surface_buffer, buffer_seek_start, (surface_w * y1 + x1) * 4);
|
||||
buffer_write(surface_buffer, buffer_u32, colorFill);
|
||||
|
@ -291,26 +292,26 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
|
||||
if(y1 > 0) {
|
||||
if(x1 == x_start && x1 > 0 && _corner) {
|
||||
if(!spanAbove && ff_fillable(colorBase, colorFill, x1 - 1, y1 - 1, _thres)) {
|
||||
if(!spanAbove && ff_fillable(colorBase, colorFill, x1 - 1, y1 - 1, thr)) {
|
||||
ds_queue_enqueue(queue, [x1 - 1, y1 - 1]);
|
||||
spanAbove = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(ff_fillable(colorBase, colorFill, x1, y1 - 1, _thres)) {
|
||||
if(ff_fillable(colorBase, colorFill, x1, y1 - 1, thr)) {
|
||||
ds_queue_enqueue(queue, [x1, y1 - 1]);
|
||||
}
|
||||
}
|
||||
|
||||
if(y1 < surface_h - 1) {
|
||||
if(x1 == x_start && x1 > 0 && _corner) {
|
||||
if(!spanBelow && ff_fillable(colorBase, colorFill, x1 - 1, y1 + 1, _thres)) {
|
||||
if(!spanBelow && ff_fillable(colorBase, colorFill, x1 - 1, y1 + 1, thr)) {
|
||||
ds_queue_enqueue(queue, [x1 - 1, y1 + 1]);
|
||||
spanBelow = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(ff_fillable(colorBase, colorFill, x1, y1 + 1, _thres)) {
|
||||
if(ff_fillable(colorBase, colorFill, x1, y1 + 1, thr)) {
|
||||
ds_queue_enqueue(queue, [x1, y1 + 1]);
|
||||
}
|
||||
}
|
||||
|
@ -319,14 +320,14 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
|
||||
if(x1 < surface_w - 1 && _corner) {
|
||||
if(y1 > 0) {
|
||||
if(!spanAbove && ff_fillable(colorBase, colorFill, x1 + 1, y1 - 1, _thres)) {
|
||||
if(!spanAbove && ff_fillable(colorBase, colorFill, x1 + 1, y1 - 1, thr)) {
|
||||
ds_queue_enqueue(queue, [x1 + 1, y1 - 1]);
|
||||
spanAbove = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(y1 < surface_h - 1) {
|
||||
if(!spanBelow && ff_fillable(colorBase, colorFill, x1 + 1, y1 + 1, _thres)) {
|
||||
if(!spanBelow && ff_fillable(colorBase, colorFill, x1 + 1, y1 + 1, thr)) {
|
||||
ds_queue_enqueue(queue, [x1 + 1, y1 + 1]);
|
||||
spanBelow = true;
|
||||
}
|
||||
|
@ -342,6 +343,7 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
var h = surface_get_height(_surf);
|
||||
|
||||
var _c1 = get_color_buffer(_x, _y);
|
||||
var thr = _thres * _thres;
|
||||
|
||||
for( var i = 0; i < w; i++ ) {
|
||||
for( var j = 0; j < h; j++ ) {
|
||||
|
@ -351,7 +353,7 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
}
|
||||
|
||||
var _c2 = get_color_buffer(i, j);
|
||||
if(color_diff(_c1, _c2) <= _thres)
|
||||
if(color_diff(_c1, _c2, true) <= thr)
|
||||
draw_point(i, j);
|
||||
}
|
||||
}
|
||||
|
@ -369,7 +371,8 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
mouse_holding = false;
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
if(!active) return;
|
||||
mouse_cur_x = round((_mx - _x) / _s - 0.5);
|
||||
mouse_cur_y = round((_my - _y) / _s - 0.5);
|
||||
|
||||
var _dim = inputs[| 0].getValue();
|
||||
var _col = inputs[| 1].getValue();
|
||||
|
@ -391,109 +394,108 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
var _tool = PANEL_PREVIEW.tool_index;
|
||||
var _sub_tool = PANEL_PREVIEW.tool_sub_index;
|
||||
|
||||
mouse_cur_x = round((_mx - _x) / _s - 0.5);
|
||||
mouse_cur_y = round((_my - _y) / _s - 0.5);
|
||||
|
||||
if(_tool == 0 || _tool == 1) {
|
||||
if(_tool == 0) BLEND_ALPHA;
|
||||
if(active) {
|
||||
if(_tool == 0 || _tool == 1) {
|
||||
if(_tool == 0) BLEND_ALPHA;
|
||||
|
||||
if(_tool == 1) {
|
||||
gpu_set_blendmode(bm_subtract);
|
||||
gpu_set_colorwriteenable(false, false, false, true);
|
||||
}
|
||||
if(_tool == 1) {
|
||||
gpu_set_blendmode(bm_subtract);
|
||||
gpu_set_colorwriteenable(false, false, false, true);
|
||||
}
|
||||
|
||||
if(key_mod_press(SHIFT) && key_mod_press(CTRL)) {
|
||||
var aa = point_direction(mouse_pre_draw_x, mouse_pre_draw_y, mouse_cur_x, mouse_cur_y);
|
||||
var dd = point_distance(mouse_pre_draw_x, mouse_pre_draw_y, mouse_cur_x, mouse_cur_y);
|
||||
var _a = round(aa / 45) * 45;
|
||||
dd = dd * cos(degtorad(_a - aa));
|
||||
if(key_mod_press(SHIFT) && key_mod_press(CTRL)) {
|
||||
var aa = point_direction(mouse_pre_draw_x, mouse_pre_draw_y, mouse_cur_x, mouse_cur_y);
|
||||
var dd = point_distance(mouse_pre_draw_x, mouse_pre_draw_y, mouse_cur_x, mouse_cur_y);
|
||||
var _a = round(aa / 45) * 45;
|
||||
dd = dd * cos(degtorad(_a - aa));
|
||||
|
||||
mouse_cur_x = mouse_pre_draw_x + lengthdir_x(dd, _a);
|
||||
mouse_cur_y = mouse_pre_draw_y + lengthdir_y(dd, _a);
|
||||
}
|
||||
mouse_cur_x = mouse_pre_draw_x + lengthdir_x(dd, _a);
|
||||
mouse_cur_y = mouse_pre_draw_y + lengthdir_y(dd, _a);
|
||||
}
|
||||
|
||||
if(mouse_press(mb_left)) {
|
||||
draw_point_size(mouse_cur_x, mouse_cur_y, _siz, _brush);
|
||||
if(mouse_press(mb_left)) {
|
||||
draw_point_size(mouse_cur_x, mouse_cur_y, _siz, _brush);
|
||||
|
||||
mouse_holding = true;
|
||||
if(key_mod_press(SHIFT)) {
|
||||
draw_line_size(mouse_pre_draw_x, mouse_pre_draw_y, mouse_cur_x, mouse_cur_y, _siz, _brush);
|
||||
mouse_holding = true;
|
||||
if(key_mod_press(SHIFT)) {
|
||||
draw_line_size(mouse_pre_draw_x, mouse_pre_draw_y, mouse_cur_x, mouse_cur_y, _siz, _brush);
|
||||
mouse_holding = false;
|
||||
}
|
||||
|
||||
mouse_pre_draw_x = mouse_cur_x;
|
||||
mouse_pre_draw_y = mouse_cur_y;
|
||||
}
|
||||
|
||||
if(mouse_holding && mouse_click(mb_left, active)) {
|
||||
if(mouse_pre_draw_x != mouse_cur_x || mouse_pre_draw_y != mouse_cur_y) {
|
||||
draw_point_size(mouse_cur_x, mouse_cur_y, _siz, _brush);
|
||||
draw_line_size(mouse_pre_draw_x, mouse_pre_draw_y, mouse_cur_x, mouse_cur_y, _siz, _brush);
|
||||
}
|
||||
|
||||
mouse_pre_draw_x = mouse_cur_x;
|
||||
mouse_pre_draw_y = mouse_cur_y;
|
||||
}
|
||||
|
||||
BLEND_NORMAL;
|
||||
|
||||
if(_tool == 1)
|
||||
gpu_set_colorwriteenable(true, true, true, true);
|
||||
|
||||
if(mouse_release(mb_left)) {
|
||||
surface_update();
|
||||
mouse_holding = false;
|
||||
}
|
||||
|
||||
mouse_pre_draw_x = mouse_cur_x;
|
||||
mouse_pre_draw_y = mouse_cur_y;
|
||||
}
|
||||
|
||||
if(mouse_holding && mouse_click(mb_left, active)) {
|
||||
if(mouse_pre_draw_x != mouse_cur_x || mouse_pre_draw_y != mouse_cur_y) {
|
||||
draw_point_size(mouse_cur_x, mouse_cur_y, _siz, _brush);
|
||||
draw_line_size(mouse_pre_draw_x, mouse_pre_draw_y, mouse_cur_x, mouse_cur_y, _siz, _brush);
|
||||
}
|
||||
|
||||
mouse_pre_draw_x = mouse_cur_x;
|
||||
mouse_pre_draw_y = mouse_cur_y;
|
||||
}
|
||||
|
||||
BLEND_NORMAL;
|
||||
|
||||
if(_tool == 1)
|
||||
gpu_set_colorwriteenable(true, true, true, true);
|
||||
|
||||
if(mouse_release(mb_left)) {
|
||||
surface_update();
|
||||
mouse_holding = false;
|
||||
}
|
||||
|
||||
mouse_pre_x = mouse_cur_x;
|
||||
mouse_pre_y = mouse_cur_y;
|
||||
apply_surface();
|
||||
|
||||
} else if(_tool == 2 || _tool == 3) {
|
||||
if(mouse_holding && key_mod_press(SHIFT)) {
|
||||
var ww = mouse_cur_x - mouse_pre_x;
|
||||
var hh = mouse_cur_y - mouse_pre_y;
|
||||
var ss = max(abs(ww), abs(hh));
|
||||
|
||||
mouse_cur_x = mouse_pre_x + ss * sign(ww);
|
||||
mouse_cur_y = mouse_pre_y + ss * sign(hh);
|
||||
}
|
||||
|
||||
if(mouse_press(mb_left)) {
|
||||
mouse_pre_x = mouse_cur_x;
|
||||
mouse_pre_y = mouse_cur_y;
|
||||
|
||||
mouse_holding = true;
|
||||
}
|
||||
apply_surface();
|
||||
|
||||
if(mouse_release(mb_left)) {
|
||||
BLEND_ALPHA;
|
||||
if(_tool == 2)
|
||||
draw_rect_size(mouse_pre_x, mouse_pre_y, mouse_cur_x, mouse_cur_y, _siz, _sub_tool, _brush);
|
||||
else if(_tool == 3)
|
||||
draw_ellp_size(mouse_pre_x, mouse_pre_y, mouse_cur_x, mouse_cur_y, _siz, _sub_tool, _brush);
|
||||
BLEND_NORMAL;
|
||||
} else if(_tool == 2 || _tool == 3) {
|
||||
if(mouse_holding && key_mod_press(SHIFT)) {
|
||||
var ww = mouse_cur_x - mouse_pre_x;
|
||||
var hh = mouse_cur_y - mouse_pre_y;
|
||||
var ss = max(abs(ww), abs(hh));
|
||||
|
||||
surface_update();
|
||||
mouse_holding = false;
|
||||
}
|
||||
apply_surface();
|
||||
|
||||
} else if(_tool == 4) {
|
||||
if(point_in_rectangle(mouse_cur_x, mouse_cur_y, 0, 0, _surf_w - 1, _surf_h - 1) && mouse_press(mb_left)) {
|
||||
switch(_fill_type) {
|
||||
case 0 :
|
||||
flood_fill_scanline(mouse_cur_x, mouse_cur_y, canvas_surface, _thr, false);
|
||||
break;
|
||||
case 1 :
|
||||
flood_fill_scanline(mouse_cur_x, mouse_cur_y, canvas_surface, _thr, true);
|
||||
break;
|
||||
case 2 :
|
||||
canvas_fill(mouse_cur_x, mouse_cur_y, canvas_surface, _thr);
|
||||
break;
|
||||
mouse_cur_x = mouse_pre_x + ss * sign(ww);
|
||||
mouse_cur_y = mouse_pre_y + ss * sign(hh);
|
||||
}
|
||||
|
||||
if(mouse_press(mb_left)) {
|
||||
mouse_pre_x = mouse_cur_x;
|
||||
mouse_pre_y = mouse_cur_y;
|
||||
|
||||
surface_update();
|
||||
mouse_holding = true;
|
||||
}
|
||||
|
||||
if(mouse_release(mb_left)) {
|
||||
BLEND_ALPHA;
|
||||
if(_tool == 2)
|
||||
draw_rect_size(mouse_pre_x, mouse_pre_y, mouse_cur_x, mouse_cur_y, _siz, _sub_tool, _brush);
|
||||
else if(_tool == 3)
|
||||
draw_ellp_size(mouse_pre_x, mouse_pre_y, mouse_cur_x, mouse_cur_y, _siz, _sub_tool, _brush);
|
||||
BLEND_NORMAL;
|
||||
|
||||
surface_update();
|
||||
mouse_holding = false;
|
||||
}
|
||||
apply_surface();
|
||||
|
||||
} else if(_tool == 4) {
|
||||
if(point_in_rectangle(mouse_cur_x, mouse_cur_y, 0, 0, _surf_w - 1, _surf_h - 1) && mouse_press(mb_left)) {
|
||||
switch(_fill_type) {
|
||||
case 0 :
|
||||
flood_fill_scanline(mouse_cur_x, mouse_cur_y, canvas_surface, _thr, false);
|
||||
break;
|
||||
case 1 :
|
||||
flood_fill_scanline(mouse_cur_x, mouse_cur_y, canvas_surface, _thr, true);
|
||||
break;
|
||||
case 2 :
|
||||
canvas_fill(mouse_cur_x, mouse_cur_y, canvas_surface, _thr);
|
||||
break;
|
||||
}
|
||||
|
||||
surface_update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -557,7 +559,7 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
#endregion
|
||||
}
|
||||
|
||||
static step = function() {
|
||||
static step = function() {
|
||||
var _outSurf = outputs[| 0].getValue();
|
||||
if(is_surface(_outSurf)) return;
|
||||
|
||||
|
|
|
@ -73,6 +73,27 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
|||
|
||||
metadata = new MetaDataManager();
|
||||
|
||||
inspUpdateTooltip = get_text("panel_inspector_execute", "Execute node contents");
|
||||
inspUpdateIcon = [ THEME.sequence_control, 1, COLORS._main_value_positive ];
|
||||
|
||||
static inspectorUpdate = function() {
|
||||
onInspectorUpdate();
|
||||
}
|
||||
static onInspectorUpdate = function() {
|
||||
RenderListAction(nodes, group);
|
||||
}
|
||||
|
||||
static hasInspectorUpdate = function(group = false) {
|
||||
if(!group) return false;
|
||||
|
||||
for( var i = 0; i < ds_list_size(nodes); i++ ) {
|
||||
if(nodes[| i].hasInspectorUpdate())
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static getNodeBase = function() {
|
||||
if(instanceBase == noone) return self;
|
||||
return instanceBase.getNodeBase();
|
||||
|
@ -156,18 +177,8 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
|||
}
|
||||
}
|
||||
|
||||
static inspectorGroupUpdate = function() {
|
||||
var node_list = getNodeList();
|
||||
for(var i = 0; i < ds_list_size(node_list); i++) {
|
||||
var _node = node_list[| i];
|
||||
if(_node.hasInspectorUpdate() == noone)
|
||||
_node.inspectorUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
static stepBegin = function() {
|
||||
use_cache = false;
|
||||
inspectorUpdate = noone;
|
||||
|
||||
array_safe_set(cache_result, ANIMATOR.current_frame, true);
|
||||
|
||||
|
@ -175,8 +186,6 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
|||
for(var i = 0; i < ds_list_size(node_list); i++) {
|
||||
var n = node_list[| i];
|
||||
n.stepBegin();
|
||||
if(n.hasInspectorUpdate())
|
||||
inspectorUpdate = inspectorGroupUpdate;
|
||||
if(!n.use_cache) continue;
|
||||
|
||||
use_cache = true;
|
||||
|
|
|
@ -11,7 +11,7 @@ function Node_Colorize(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
|
||||
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
|
||||
inputs[| 1] = nodeValue("Gradient", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, [ new gradientKey(0, c_black), new gradientKey(1, c_white) ] )
|
||||
inputs[| 1] = nodeValue("Gradient", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, new gradientObject([ c_black, c_white ]) )
|
||||
.setDisplay(VALUE_DISPLAY.gradient);
|
||||
|
||||
inputs[| 2] = nodeValue("Gradient shift", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
|
||||
|
@ -36,11 +36,10 @@ function Node_Colorize(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
|
||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var _gra = _data[1];
|
||||
var _gra_data = inputs[| 1].getExtraData();
|
||||
var _gra_shift = _data[2];
|
||||
var _alpha = _data[6];
|
||||
|
||||
var _grad = gradient_to_array(_gra);
|
||||
var _grad = _gra.toArray();
|
||||
var _grad_color = _grad[0];
|
||||
var _grad_time = _grad[1];
|
||||
|
||||
|
@ -49,11 +48,11 @@ function Node_Colorize(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
BLEND_OVERRIDE;
|
||||
|
||||
shader_set(shader);
|
||||
shader_set_uniform_i(uniform_grad_blend, ds_list_get(_gra_data, 0));
|
||||
shader_set_uniform_i(uniform_grad_blend, _gra.type);
|
||||
shader_set_uniform_f_array_safe(uniform_color, _grad_color);
|
||||
shader_set_uniform_f_array_safe(uniform_time, _grad_time);
|
||||
shader_set_uniform_f(uniform_shift, _gra_shift);
|
||||
shader_set_uniform_i(uniform_key, array_length(_gra));
|
||||
shader_set_uniform_i(uniform_key, array_length(_gra.keys));
|
||||
shader_set_uniform_i(uniform_alpha, _alpha);
|
||||
|
||||
draw_surface_safe(_data[0], 0, 0);
|
||||
|
|
|
@ -492,24 +492,35 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
|
|||
var frx = jun.value_from.x;
|
||||
var fry = jun.value_from.y;
|
||||
|
||||
var c0 = value_color(jun.value_from.type);
|
||||
var c1 = value_color(jun.type);
|
||||
var c0 = value_color(jun.value_from.type);
|
||||
var c1 = value_color(jun.type);
|
||||
|
||||
var shx = jun.draw_line_shift_x * _s;
|
||||
var shy = jun.draw_line_shift_y * _s;
|
||||
|
||||
var cx = round((frx + jx) / 2 + shx);
|
||||
var cy = round((fry + jy) / 2 + shy);
|
||||
|
||||
var hover = false;
|
||||
var th = max(1, PREF_MAP[? "connection_line_width"] * _s);
|
||||
|
||||
if(PANEL_GRAPH.pHOVER)
|
||||
switch(PREF_MAP[? "curve_connection_line"]) {
|
||||
case 0 :
|
||||
hover = distance_to_line(mx, my, jx, jy, frx, fry) < 6;
|
||||
hover = distance_to_line(mx, my, jx, jy, frx, fry) < max(th * 2, 6);
|
||||
break;
|
||||
case 1 :
|
||||
hover = distance_to_curve(mx, my, jx, jy, frx, fry) < 6;
|
||||
hover = distance_to_curve(mx, my, jx, jy, frx, fry, cx, cy, _s) < max(th * 2, 6);
|
||||
jun.draw_line_shift_hover = hover;
|
||||
break;
|
||||
case 2 :
|
||||
var cx = (jx + frx) / 2;
|
||||
hover = distance_to_line(mx, my, jx, jy, cx, jy) < 6;
|
||||
hover |= distance_to_line(mx, my, cx, jy, cx, fry) < 6;
|
||||
hover |= distance_to_line(mx, my, cx, fry, frx, fry) < 6;
|
||||
var ch = distance_to_line(mx, my, cx, jy, cx, fry) < max(th * 2, 6);
|
||||
|
||||
hover = distance_to_line(mx, my, jx, jy, cx, jy) < max(th * 2, 6);
|
||||
hover |= ch;
|
||||
hover |= distance_to_line(mx, my, cx, fry, frx, fry) < max(th * 2, 6);
|
||||
|
||||
jun.draw_line_shift_hover = ch;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -530,8 +541,8 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
|
|||
else
|
||||
draw_line_dashed_color(jx, jy, frx, fry, th, c1, c0, 12 * _s);
|
||||
break;
|
||||
case 1 : draw_line_curve_color(jx, jy, frx, fry, th, c0, c1, ty); break;
|
||||
case 2 : draw_line_elbow_color(jx, jy, frx, fry, th, c0, c1, ty); break;
|
||||
case 1 : draw_line_curve_color(jx, jy, frx, fry, cx, cy, _s, th, c0, c1, ty); break;
|
||||
case 2 : draw_line_elbow_color(jx, jy, frx, fry, cx, th, c1, c0, ty); break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -781,9 +792,9 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
|
|||
|
||||
if(_to.node.isUpdateReady()) {
|
||||
ds_queue_enqueue(RENDER_QUEUE, _to.node);
|
||||
printIf(global.RENDER_LOG, " > Push " + _to.node.name + " node to stack");
|
||||
printIf(global.RENDER_LOG, " >| Push " + _to.node.name + " (" + _to.node.display_name + ") node to stack");
|
||||
} else
|
||||
printIf(global.RENDER_LOG, " > Node " + _to.node.name + " not ready");
|
||||
printIf(global.RENDER_LOG, " >| Node " + _to.node.name + " not ready");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -794,22 +805,25 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
|
|||
}
|
||||
|
||||
static cacheArrayCheck = function() {
|
||||
if(array_length(cached_output) != ANIMATOR.frames_total + 1)
|
||||
array_resize(cached_output, ANIMATOR.frames_total + 1);
|
||||
if(array_length(cache_result) != ANIMATOR.frames_total + 1)
|
||||
array_resize(cache_result, ANIMATOR.frames_total + 1);
|
||||
if(array_length(cached_output) != ANIMATOR.frames_total)
|
||||
array_resize(cached_output, ANIMATOR.frames_total);
|
||||
if(array_length(cache_result) != ANIMATOR.frames_total)
|
||||
array_resize(cache_result, ANIMATOR.frames_total);
|
||||
}
|
||||
|
||||
static cacheCurrentFrame = function(_frame) {
|
||||
cacheArrayCheck();
|
||||
if(ANIMATOR.current_frame > ANIMATOR.frames_total) return;
|
||||
if(ANIMATOR.current_frame < 0) return;
|
||||
|
||||
cached_output[ANIMATOR.current_frame] = surface_clone(_frame, cached_output[ANIMATOR.current_frame]);
|
||||
surface_array_free(cached_output[ANIMATOR.current_frame]);
|
||||
cached_output[ANIMATOR.current_frame] = surface_array_clone(_frame);
|
||||
|
||||
array_safe_set(cache_result, ANIMATOR.current_frame, true);
|
||||
}
|
||||
|
||||
static cacheExist = function(frame = ANIMATOR.current_frame) {
|
||||
if(frame < 0) return false;
|
||||
|
||||
if(frame >= array_length(cached_output)) return false;
|
||||
if(frame >= array_length(cache_result)) return false;
|
||||
if(!array_safe_get(cache_result, frame, false)) return false;
|
||||
|
@ -817,6 +831,8 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
|
|||
}
|
||||
|
||||
static getCacheFrame = function(frame = ANIMATOR.current_frame) {
|
||||
if(frame < 0) return false;
|
||||
|
||||
if(!cacheExist(frame)) return noone;
|
||||
var surf = array_safe_get(cached_output, frame);
|
||||
return surf;
|
||||
|
@ -826,23 +842,15 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
|
|||
if(!cacheExist(frame)) return false;
|
||||
|
||||
var _s = cached_output[ANIMATOR.current_frame];
|
||||
if(!is_surface(_s)) return false;
|
||||
|
||||
var _outSurf = outputs[| 0].getValue();
|
||||
if(is_surface(_outSurf))
|
||||
surface_copy_size(_outSurf, _s);
|
||||
else {
|
||||
_outSurf = surface_clone(_s);
|
||||
outputs[| 0].setValue(_outSurf);
|
||||
}
|
||||
outputs[| 0].setValue(_s);
|
||||
|
||||
return true;
|
||||
}
|
||||
static clearCache = function() {
|
||||
static clearCache = function() {
|
||||
if(!use_cache) return;
|
||||
|
||||
if(array_length(cached_output) != ANIMATOR.frames_total + 1)
|
||||
array_resize(cached_output, ANIMATOR.frames_total + 1);
|
||||
if(array_length(cached_output) != ANIMATOR.frames_total)
|
||||
array_resize(cached_output, ANIMATOR.frames_total);
|
||||
for(var i = 0; i < array_length(cached_output); i++) {
|
||||
var _s = cached_output[i];
|
||||
if(is_surface(_s))
|
||||
|
@ -986,7 +994,8 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
|
|||
|
||||
if(ds_map_exists(load_map, "name"))
|
||||
display_name = ds_map_try_get(load_map, "name", "");
|
||||
_group = ds_map_try_get(load_map, "group");
|
||||
_group = ds_map_try_get(load_map, "group", noone);
|
||||
if(_group == -1) _group = noone;
|
||||
|
||||
x = ds_map_try_get(load_map, "x");
|
||||
y = ds_map_try_get(load_map, "y");
|
||||
|
|
|
@ -79,6 +79,8 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
.setDisplay(VALUE_DISPLAY.slider, [0, 100, 1])
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 11] = nodeValue("Sequence begin", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
|
||||
outputs[| 0] = nodeValue("Loop exit", self, JUNCTION_CONNECT.output, VALUE_TYPE.any, 0);
|
||||
|
||||
outputs[| 1] = nodeValue("Preview", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone)
|
||||
|
@ -87,7 +89,7 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
input_display_list = [
|
||||
["Export", false], 0, 1, 2, 4,
|
||||
["Format ", false], 3, 9,
|
||||
["Settings", false], 8, 5, 6, 7, 10,
|
||||
["Settings", false], 8, 5, 6, 7, 10, 11,
|
||||
];
|
||||
|
||||
directory = DIRECTORY + "temp\\" + string(irandom_range(100000, 999999));
|
||||
|
@ -173,7 +175,8 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
}
|
||||
|
||||
static pathString = function(path, suff, index = 0) {
|
||||
var form = inputs[| 3].getValue();
|
||||
var form = inputs[| 3].getValue();
|
||||
var strt = inputs[| 11].getValue();
|
||||
|
||||
var s = "", i = 1, ch, ch_s;
|
||||
var len = string_length(suff);
|
||||
|
@ -191,12 +194,12 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
var float_str = string_digits(str);
|
||||
if(float_str != "") {
|
||||
var float_val = string_digits(float_str);
|
||||
var str_val = max(float_val - string_length(string(ANIMATOR.current_frame + 1)), 0);
|
||||
var str_val = max(float_val - string_length(string(ANIMATOR.current_frame + strt)), 0);
|
||||
repeat(str_val)
|
||||
s += "0";
|
||||
}
|
||||
|
||||
s += string(ANIMATOR.current_frame + 1);
|
||||
s += string(ANIMATOR.current_frame + strt);
|
||||
res = true;
|
||||
break;
|
||||
case "i" :
|
||||
|
@ -299,7 +302,7 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
if(!is_surface(_surf)) continue;
|
||||
|
||||
if(form == NODE_EXPORT_FORMAT.gif) {
|
||||
p = directory + "\\" + string(i) + "\\" + string(100000 + ANIMATOR.current_frame + 1) + ".png";
|
||||
p = directory + "\\" + string(i) + "\\" + string_lead_zero(ANIMATOR.current_frame, 5) + ".png";
|
||||
} else {
|
||||
if(is_array(path) && array_length(path) == array_length(surf))
|
||||
p = pathString(path[ safe_mod(i, array_length(path)) ], suff, i);
|
||||
|
@ -322,7 +325,7 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
if(is_array(path)) p = path[0];
|
||||
|
||||
if(form == NODE_EXPORT_FORMAT.gif)
|
||||
p = directory + "\\" + string(100000 + ANIMATOR.current_frame + 1) + ".png";
|
||||
p = directory + "\\" + string_lead_zero(ANIMATOR.current_frame, 5) + ".png";
|
||||
else
|
||||
p = pathString(p, suff);
|
||||
|
||||
|
@ -344,7 +347,7 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
insp2UpdateTooltip = "Export All";
|
||||
insp2UpdateIcon = [ THEME.play_all, 0, COLORS._main_value_positive ];
|
||||
|
||||
static onInspectorUpdate = function() {
|
||||
static onInspectorUpdate = function() {
|
||||
if(isInLoop()) UPDATE |= RENDER_TYPE.full;
|
||||
else doInspectorAction();
|
||||
}
|
||||
|
@ -366,7 +369,6 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
|
||||
static doInspectorAction = function() {
|
||||
if(LOADING || APPENDING) return;
|
||||
if(playing) return;
|
||||
|
||||
var path = inputs[| 1].getValue();
|
||||
if(path == "") return;
|
||||
|
@ -404,10 +406,11 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
var anim = inputs[| 3].getValue();
|
||||
var extn = inputs[| 9].getValue();
|
||||
|
||||
inputs[| 5].setVisible(anim == 2);
|
||||
inputs[| 6].setVisible(anim == 2);
|
||||
inputs[| 7].setVisible(anim == 2);
|
||||
inputs[| 8].setVisible(anim == 2);
|
||||
inputs[| 5].setVisible(anim == 2);
|
||||
inputs[| 6].setVisible(anim == 2);
|
||||
inputs[| 7].setVisible(anim == 2);
|
||||
inputs[| 8].setVisible(anim == 2);
|
||||
inputs[| 11].setVisible(anim == 1);
|
||||
|
||||
if(anim == NODE_EXPORT_FORMAT.gif) {
|
||||
inputs[| 9].display_data = format_animation;
|
||||
|
|
|
@ -2,6 +2,7 @@ function Node_Fluid_Render(_x, _y, _group = noone) : Node_Fluid(_x, _y, _group)
|
|||
name = "Render Domain";
|
||||
color = COLORS.node_blend_fluid;
|
||||
icon = THEME.fluid_sim;
|
||||
use_cache = true;
|
||||
|
||||
inputs[| 0] = nodeValue("Fluid Domain", self, JUNCTION_CONNECT.input, VALUE_TYPE.fdomain, noone)
|
||||
.setVisible(true, true);
|
||||
|
@ -22,7 +23,15 @@ function Node_Fluid_Render(_x, _y, _group = noone) : Node_Fluid(_x, _y, _group)
|
|||
|
||||
outputs[| 1] = nodeValue("Domain", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
||||
|
||||
insp2UpdateTooltip = "Clear cache";
|
||||
insp2UpdateIcon = [ THEME.cache, 0, COLORS._main_icon ];
|
||||
|
||||
static onInspector2Update = function() { clearCache(); }
|
||||
|
||||
static update = function(frame = ANIMATOR.current_frame) {
|
||||
if(recoverCache() || !ANIMATOR.is_playing)
|
||||
return;
|
||||
|
||||
var _dom = inputs[| 0].getValue(frame);
|
||||
var _dim = inputs[| 1].getValue(frame);
|
||||
var _int = inputs[| 2].getValue(frame);
|
||||
|
@ -52,5 +61,7 @@ function Node_Fluid_Render(_x, _y, _group = noone) : Node_Fluid(_x, _y, _group)
|
|||
if(_drw && is_surface(_dom.sf_world))
|
||||
draw_surface_stretched(_dom.sf_world, 0, 0, _dim[0], _dim[1]);
|
||||
surface_reset_target();
|
||||
|
||||
cacheCurrentFrame(_outSurf);
|
||||
}
|
||||
}
|
|
@ -18,6 +18,8 @@ function Node_Fluid_Update(_x, _y, _group = noone) : Node_Fluid(_x, _y, _group)
|
|||
outputs[| 0] = nodeValue("Fluid Domain", self, JUNCTION_CONNECT.output, VALUE_TYPE.fdomain, noone);
|
||||
|
||||
static update = function(frame = ANIMATOR.current_frame) {
|
||||
if(!ANIMATOR.is_playing) return;
|
||||
|
||||
var _dom = inputs[| 0].getValue(frame);
|
||||
var _act = inputs[| 1].getValue(frame);
|
||||
if(_dom == noone || !instance_exists(_dom)) return;
|
||||
|
|
|
@ -18,7 +18,7 @@ function Node_Gradient(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
inputs[| 0] = nodeValue("Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, def_surf_size2 )
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 1] = nodeValue("Gradient", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, [ new gradientKey(0, c_white) ] )
|
||||
inputs[| 1] = nodeValue("Gradient", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, new gradientObject(c_white) )
|
||||
.setDisplay(VALUE_DISPLAY.gradient);
|
||||
|
||||
inputs[| 2] = nodeValue("Type", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
|
@ -58,7 +58,6 @@ function Node_Gradient(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1]);
|
||||
|
||||
var _gra = _data[1];
|
||||
var _gra_data = inputs[| 1].getExtraData();
|
||||
|
||||
var _typ = _data[2];
|
||||
var _ang = _data[3];
|
||||
|
@ -68,7 +67,7 @@ function Node_Gradient(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
var _lop = _data[7];
|
||||
var _msk = _data[8];
|
||||
|
||||
var _grad = gradient_to_array(_gra);
|
||||
var _grad = _gra.toArray();
|
||||
var _grad_color = _grad[0];
|
||||
var _grad_time = _grad[1];
|
||||
|
||||
|
@ -83,10 +82,10 @@ function Node_Gradient(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
surface_set_target(_outSurf);
|
||||
draw_clear_alpha(0, 0);
|
||||
shader_set(shader);
|
||||
shader_set_uniform_i(uniform_grad_blend, ds_list_get(_gra_data, 0));
|
||||
shader_set_uniform_i(uniform_grad_blend, _gra.type);
|
||||
shader_set_uniform_f_array_safe(uniform_grad, _grad_color);
|
||||
shader_set_uniform_f_array_safe(uniform_grad_time, _grad_time);
|
||||
shader_set_uniform_i(uniform_grad_key, array_length(_gra));
|
||||
shader_set_uniform_i(uniform_grad_key, array_length(_gra.keys));
|
||||
shader_set_uniform_i(uniform_grad_loop, _lop);
|
||||
|
||||
shader_set_uniform_f_array_safe(uniform_center, [_cnt[0] / _dim[0], _cnt[1] / _dim[1]]);
|
||||
|
|
12
scripts/node_gradient_extract/node_array.yy
Normal file
12
scripts/node_gradient_extract/node_array.yy
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "variable",
|
||||
"path": "folders/nodes/data/variable.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "node_array",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
12
scripts/node_gradient_extract/node_counter.yy
Normal file
12
scripts/node_gradient_extract/node_counter.yy
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "variable",
|
||||
"path": "folders/nodes/data/variable.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "node_counter",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
52
scripts/node_gradient_extract/node_gradient_extract.gml
Normal file
52
scripts/node_gradient_extract/node_gradient_extract.gml
Normal file
|
@ -0,0 +1,52 @@
|
|||
function Node_Gradient_Extract(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Gradient Data";
|
||||
previewable = false;
|
||||
|
||||
w = 96;
|
||||
|
||||
inputs[| 0] = nodeValue("Gradient", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, new gradientObject(c_white) )
|
||||
.setDisplay(VALUE_DISPLAY.gradient)
|
||||
.setVisible(true, true);
|
||||
|
||||
outputs[| 0] = nodeValue("Colors", self, JUNCTION_CONNECT.output, VALUE_TYPE.color, [] )
|
||||
.setDisplay(VALUE_DISPLAY.palette);
|
||||
|
||||
outputs[| 1] = nodeValue("Positions", self, JUNCTION_CONNECT.output, VALUE_TYPE.float, [] );
|
||||
outputs[| 1].array_depth = 1;
|
||||
|
||||
outputs[| 2] = nodeValue("Type", self, JUNCTION_CONNECT.output, VALUE_TYPE.integer, 0 );
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var gra = _data[0];
|
||||
|
||||
switch(_output_index) {
|
||||
case 0 :
|
||||
var pal = [];
|
||||
for( var i = 0; i < array_length(gra.keys); i++ )
|
||||
pal[i] = gra.keys[i].value;
|
||||
return pal;
|
||||
case 1 :
|
||||
var pos = [];
|
||||
for( var i = 0; i < array_length(gra.keys); i++ )
|
||||
pos[i] = gra.keys[i].time;
|
||||
return pos;
|
||||
case 2 :
|
||||
return gra.type;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s) {
|
||||
var bbox = drawGetBbox(xx, yy, _s);
|
||||
if(bbox.h < 1) return;
|
||||
|
||||
var grad = inputs[| 0].getValue();
|
||||
if(is_array(grad)) {
|
||||
if(array_length(grad) == 0) return;
|
||||
grad = grad[0];
|
||||
}
|
||||
|
||||
grad.draw(bbox.x0, bbox.y0, bbox.w, bbox.h);
|
||||
}
|
||||
}
|
11
scripts/node_gradient_extract/node_gradient_extract.yy
Normal file
11
scripts/node_gradient_extract/node_gradient_extract.yy
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"resourceType": "GMScript",
|
||||
"resourceVersion": "1.0",
|
||||
"name": "node_gradient_extract",
|
||||
"isCompatibility": false,
|
||||
"isDnD": false,
|
||||
"parent": {
|
||||
"name": "color",
|
||||
"path": "folders/nodes/data/value/color.yy",
|
||||
},
|
||||
}
|
|
@ -4,14 +4,14 @@ function Node_Gradient_Out(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
|
||||
w = 96;
|
||||
|
||||
inputs[| 0] = nodeValue("Gradient", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, [ new gradientKey(0, c_white) ] )
|
||||
inputs[| 0] = nodeValue("Gradient", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, new gradientObject(c_white) )
|
||||
.setDisplay(VALUE_DISPLAY.gradient);
|
||||
|
||||
inputs[| 1] = nodeValue("Sample", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0, "Position to sample a color from the gradient.")
|
||||
.setDisplay(VALUE_DISPLAY.slider, [0, 1, 0.01])
|
||||
.rejectArray();
|
||||
|
||||
outputs[| 0] = nodeValue("Gradient", self, JUNCTION_CONNECT.output, VALUE_TYPE.color, [ new gradientKey(0, c_white) ] )
|
||||
outputs[| 0] = nodeValue("Gradient", self, JUNCTION_CONNECT.output, VALUE_TYPE.color, new gradientObject(c_white) )
|
||||
.setDisplay(VALUE_DISPLAY.gradient);
|
||||
|
||||
outputs[| 1] = nodeValue("Color", self, JUNCTION_CONNECT.output, VALUE_TYPE.color, c_white);
|
||||
|
@ -23,7 +23,7 @@ function Node_Gradient_Out(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
var pos = _data[1];
|
||||
|
||||
if(_output_index == 0) return pal;
|
||||
if(_output_index == 1) return gradient_eval(pal, pos);
|
||||
if(_output_index == 1) return pal.eval(pos);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -32,6 +32,6 @@ function Node_Gradient_Out(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
if(bbox.h < 1) return;
|
||||
|
||||
var grad = getSingleValue(0);
|
||||
draw_gradient(bbox.x0, bbox.y0, bbox.w, bbox.h, grad, inputs[| 0].extra_data[| 0]);
|
||||
grad.draw(bbox.x0, bbox.y0, bbox.w, bbox.h);
|
||||
}
|
||||
}
|
12
scripts/node_gradient_palette/node_array.yy
Normal file
12
scripts/node_gradient_palette/node_array.yy
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "variable",
|
||||
"path": "folders/nodes/data/variable.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "node_array",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
12
scripts/node_gradient_palette/node_counter.yy
Normal file
12
scripts/node_gradient_palette/node_counter.yy
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "variable",
|
||||
"path": "folders/nodes/data/variable.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "node_counter",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
66
scripts/node_gradient_palette/node_gradient_palette.gml
Normal file
66
scripts/node_gradient_palette/node_gradient_palette.gml
Normal file
|
@ -0,0 +1,66 @@
|
|||
function Node_Gradient_Palette(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Gradient Palette";
|
||||
previewable = false;
|
||||
|
||||
w = 96;
|
||||
|
||||
inputs[| 0] = nodeValue("Palette", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, [ c_black ] )
|
||||
.setDisplay(VALUE_DISPLAY.palette)
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| 1] = nodeValue("Custom positions", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false);
|
||||
|
||||
inputs[| 2] = nodeValue("Positions", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [], "Array of number indicating color position (0 - 1).")
|
||||
.setVisible(true, true);
|
||||
inputs[| 2].array_depth = 1;
|
||||
|
||||
inputs[| 3] = nodeValue("Blending", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
.setDisplay(VALUE_DISPLAY.enum_button, [ "RGB", "HSV", "Hard" ]);
|
||||
|
||||
outputs[| 0] = nodeValue("Gradient", self, JUNCTION_CONNECT.output, VALUE_TYPE.color, new gradientObject(c_white) )
|
||||
.setDisplay(VALUE_DISPLAY.gradient);
|
||||
|
||||
_pal = -1;
|
||||
|
||||
static step = function() {
|
||||
var usePos = array_safe_get(current_data, 1);
|
||||
inputs[| 2].setVisible(usePos, usePos);
|
||||
}
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var pal = _data[0];
|
||||
var pos_use = _data[1];
|
||||
var _pos = _data[2];
|
||||
var type = _data[3];
|
||||
|
||||
var grad = new gradientObject();
|
||||
grad.keys = [];
|
||||
|
||||
for( var i = 0; i < array_length(pal); i++ ) {
|
||||
var clr = pal[i];
|
||||
var pos = pos_use? array_safe_get(_pos, i, 0) : i / array_length(pal);
|
||||
|
||||
grad.keys[i] = new gradientKey(pos, clr);
|
||||
}
|
||||
switch(type) {
|
||||
case 0 : grad.type = GRADIENT_INTER.smooth; break;
|
||||
case 1 : grad.type = GRADIENT_INTER.hue; break;
|
||||
case 2 : grad.type = GRADIENT_INTER.none; break;
|
||||
}
|
||||
|
||||
return grad;
|
||||
}
|
||||
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s) {
|
||||
var bbox = drawGetBbox(xx, yy, _s);
|
||||
if(bbox.h < 1) return;
|
||||
|
||||
var grad = outputs[| 0].getValue();
|
||||
if(is_array(grad)) {
|
||||
if(array_length(grad) == 0) return;
|
||||
grad = grad[0];
|
||||
}
|
||||
|
||||
grad.draw(bbox.x0, bbox.y0, bbox.w, bbox.h);
|
||||
}
|
||||
}
|
11
scripts/node_gradient_palette/node_gradient_palette.yy
Normal file
11
scripts/node_gradient_palette/node_gradient_palette.yy
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"resourceType": "GMScript",
|
||||
"resourceVersion": "1.0",
|
||||
"name": "node_gradient_palette",
|
||||
"isCompatibility": false,
|
||||
"isDnD": false,
|
||||
"parent": {
|
||||
"name": "color",
|
||||
"path": "folders/nodes/data/value/color.yy",
|
||||
},
|
||||
}
|
12
scripts/node_gradient_replace/node_array.yy
Normal file
12
scripts/node_gradient_replace/node_array.yy
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "variable",
|
||||
"path": "folders/nodes/data/variable.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "node_array",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
12
scripts/node_gradient_replace/node_counter.yy
Normal file
12
scripts/node_gradient_replace/node_counter.yy
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "variable",
|
||||
"path": "folders/nodes/data/variable.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "node_counter",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
66
scripts/node_gradient_replace/node_gradient_replace.gml
Normal file
66
scripts/node_gradient_replace/node_gradient_replace.gml
Normal file
|
@ -0,0 +1,66 @@
|
|||
function Node_Gradient_Replace_Color(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Gradient Replace";
|
||||
previewable = false;
|
||||
|
||||
w = 96;
|
||||
|
||||
inputs[| 0] = nodeValue("Gradient", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, new gradientObject(c_white) )
|
||||
.setDisplay(VALUE_DISPLAY.gradient)
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| 1] = nodeValue("Color from", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, [ c_black ])
|
||||
.setDisplay(VALUE_DISPLAY.palette);
|
||||
|
||||
inputs[| 2] = nodeValue("Color to", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, [ c_black ])
|
||||
.setDisplay(VALUE_DISPLAY.palette);
|
||||
|
||||
inputs[| 3] = nodeValue("Threshold", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.1)
|
||||
.setDisplay(VALUE_DISPLAY.slider, [0, 1, 0.01]);
|
||||
|
||||
outputs[| 0] = nodeValue("Gradient", self, JUNCTION_CONNECT.output, VALUE_TYPE.color, new gradientObject(c_white) )
|
||||
.setDisplay(VALUE_DISPLAY.gradient);
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var gra = _data[0];
|
||||
var pfr = _data[1];
|
||||
var pto = _data[2];
|
||||
var thr = _data[3];
|
||||
var graO = new gradientObject();
|
||||
|
||||
for( var i = 0; i < array_length(gra.keys); i++ ) {
|
||||
var k = gra.keys[i];
|
||||
|
||||
var fromValue = 999;
|
||||
var fromIndex = -1;
|
||||
for( var j = 0; j < array_length(pfr); j++ ) {
|
||||
var fr = pfr[j];
|
||||
|
||||
var dist = color_diff(k.value, fr);
|
||||
if(dist <= thr && dist < fromValue) {
|
||||
fromValue = dist;
|
||||
fromIndex = j;
|
||||
}
|
||||
}
|
||||
|
||||
var cTo = fromIndex == -1? k.value : array_safe_get(pto, fromIndex, k.value, ARRAY_OVERFLOW.loop);
|
||||
graO.keys[i] = new gradientKey(k.time, cTo);
|
||||
}
|
||||
|
||||
graO.type = gra.type;
|
||||
|
||||
return graO;
|
||||
}
|
||||
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s) {
|
||||
var bbox = drawGetBbox(xx, yy, _s);
|
||||
if(bbox.h < 1) return;
|
||||
|
||||
var grad = outputs[| 0].getValue();
|
||||
if(is_array(grad)) {
|
||||
if(array_length(grad) == 0) return;
|
||||
grad = grad[0];
|
||||
}
|
||||
|
||||
grad.draw(bbox.x0, bbox.y0, bbox.w, bbox.h);
|
||||
}
|
||||
}
|
11
scripts/node_gradient_replace/node_gradient_replace.yy
Normal file
11
scripts/node_gradient_replace/node_gradient_replace.yy
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"resourceType": "GMScript",
|
||||
"resourceVersion": "1.0",
|
||||
"name": "node_gradient_replace",
|
||||
"isCompatibility": false,
|
||||
"isDnD": false,
|
||||
"parent": {
|
||||
"name": "color",
|
||||
"path": "folders/nodes/data/value/color.yy",
|
||||
},
|
||||
}
|
|
@ -4,15 +4,16 @@ function Node_Gradient_Shift(_x, _y, _group = noone) : Node_Processor(_x, _y, _g
|
|||
|
||||
w = 96;
|
||||
|
||||
inputs[| 0] = nodeValue("Gradient", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, [ new gradientKey(0, c_white) ] )
|
||||
.setDisplay(VALUE_DISPLAY.gradient);
|
||||
inputs[| 0] = nodeValue("Gradient", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, new gradientObject(c_white) )
|
||||
.setDisplay(VALUE_DISPLAY.gradient)
|
||||
.setDisplay(true, true);
|
||||
|
||||
inputs[| 1] = nodeValue("Shift", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
|
||||
.setDisplay(VALUE_DISPLAY.slider, [-1, 1, 0.01]);
|
||||
|
||||
inputs[| 2] = nodeValue("Loop", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false)
|
||||
|
||||
outputs[| 0] = nodeValue("Gradient", self, JUNCTION_CONNECT.output, VALUE_TYPE.color, [ new gradientKey(0, c_white) ] )
|
||||
outputs[| 0] = nodeValue("Gradient", self, JUNCTION_CONNECT.output, VALUE_TYPE.color, new gradientObject(c_white) )
|
||||
.setDisplay(VALUE_DISPLAY.gradient);
|
||||
|
||||
_pal = -1;
|
||||
|
@ -22,13 +23,14 @@ function Node_Gradient_Shift(_x, _y, _group = noone) : Node_Processor(_x, _y, _g
|
|||
var sft = _data[1];
|
||||
var lop = _data[2];
|
||||
|
||||
_outSurf = [];
|
||||
for( var i = 0; i < array_length(pal); i++ ) {
|
||||
var k = pal[i];
|
||||
_outSurf[i] = new gradientKey(k.time + sft, k.value);
|
||||
if(lop) _outSurf[i].time = frac(_outSurf[i].time);
|
||||
_outSurf = new gradientObject();
|
||||
for( var i = 0; i < array_length(pal.keys); i++ ) {
|
||||
var k = pal.keys[i];
|
||||
_outSurf.keys[i] = new gradientKey(k.time + sft, k.value);
|
||||
if(lop) _outSurf.keys[i].time = frac(_outSurf.keys[i].time);
|
||||
}
|
||||
|
||||
_outSurf.type = pal.type;
|
||||
return _outSurf;
|
||||
}
|
||||
|
||||
|
@ -37,6 +39,6 @@ function Node_Gradient_Shift(_x, _y, _group = noone) : Node_Processor(_x, _y, _g
|
|||
if(bbox.h < 1) return;
|
||||
|
||||
var grad = outputs[| 0].getValue();
|
||||
draw_gradient(bbox.x0, bbox.y0, bbox.w, bbox.h, grad, inputs[| 0].extra_data[| 0]);
|
||||
grad.draw(bbox.x0, bbox.y0, bbox.w, bbox.h);
|
||||
}
|
||||
}
|
|
@ -34,7 +34,7 @@ function Node_Grid(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
|
|||
inputs[| 4] = nodeValue("Angle", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
|
||||
.setDisplay(VALUE_DISPLAY.rotation);
|
||||
|
||||
inputs[| 5] = nodeValue("Tile color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, [ new gradientKey(0, c_white) ] )
|
||||
inputs[| 5] = nodeValue("Tile color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, new gradientObject(c_white) )
|
||||
.setDisplay(VALUE_DISPLAY.gradient);
|
||||
|
||||
inputs[| 6] = nodeValue("Gap color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_black);
|
||||
|
@ -79,8 +79,7 @@ function Node_Grid(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
|
|||
var _col_gap = _data[6];
|
||||
var _gra = _data[5];
|
||||
|
||||
var _gra_data = inputs[| 5].getExtraData();
|
||||
var _grad = gradient_to_array(_gra);
|
||||
var _grad = _gra.toArray();;
|
||||
var _grad_color = _grad[0];
|
||||
var _grad_time = _grad[1];
|
||||
|
||||
|
@ -105,10 +104,10 @@ function Node_Grid(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
|
|||
|
||||
shader_set_uniform_f_array_safe(uniform_col_gap, colToVec4(_col_gap));
|
||||
|
||||
shader_set_uniform_i(uniform_grad_blend, ds_list_get(_gra_data, 0));
|
||||
shader_set_uniform_i(uniform_grad_blend, _gra.type);
|
||||
shader_set_uniform_f_array_safe(uniform_grad, _grad_color);
|
||||
shader_set_uniform_f_array_safe(uniform_grad_time, _grad_time);
|
||||
shader_set_uniform_i(uniform_grad_key, array_length(_gra));
|
||||
shader_set_uniform_i(uniform_grad_key, array_length(_gra.keys));
|
||||
|
||||
if(is_surface(_sam))
|
||||
draw_surface_stretched(_sam, 0, 0, _dim[0], _dim[1]);
|
||||
|
|
|
@ -32,7 +32,7 @@ function Node_Grid_Hex(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
inputs[| 4] = nodeValue("Gap", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.1)
|
||||
.setDisplay(VALUE_DISPLAY.slider, [0, 0.5, 0.01]);
|
||||
|
||||
inputs[| 5] = nodeValue("Tile color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, [ new gradientKey(0, c_white) ] )
|
||||
inputs[| 5] = nodeValue("Tile color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, new gradientObject(c_white) )
|
||||
.setDisplay(VALUE_DISPLAY.gradient);
|
||||
|
||||
inputs[| 6] = nodeValue("Gap color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_black);
|
||||
|
@ -69,8 +69,7 @@ function Node_Grid_Hex(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
var _col_gap = _data[6];
|
||||
var _gra = _data[5];
|
||||
|
||||
var _gra_data = inputs[| 5].getExtraData();
|
||||
var _grad = gradient_to_array(_gra);
|
||||
var _grad = _gra.toArray();
|
||||
var _grad_color = _grad[0];
|
||||
var _grad_time = _grad[1];
|
||||
|
||||
|
@ -93,10 +92,10 @@ function Node_Grid_Hex(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
|
||||
shader_set_uniform_f_array_safe(uniform_col_gap, colToVec4(_col_gap));
|
||||
|
||||
shader_set_uniform_i(uniform_grad_blend, ds_list_get(_gra_data, 0));
|
||||
shader_set_uniform_i(uniform_grad_blend, _gra.type);
|
||||
shader_set_uniform_f_array_safe(uniform_grad, _grad_color);
|
||||
shader_set_uniform_f_array_safe(uniform_grad_time, _grad_time);
|
||||
shader_set_uniform_i(uniform_grad_key, array_length(_gra));
|
||||
shader_set_uniform_i(uniform_grad_key, array_length(_gra.keys));
|
||||
|
||||
if(is_surface(_sam))
|
||||
draw_surface_stretched(_sam, 0, 0, _dim[0], _dim[1]);
|
||||
|
|
|
@ -32,7 +32,7 @@ function Node_Grid_Tri(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
inputs[| 4] = nodeValue("Angle", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
|
||||
.setDisplay(VALUE_DISPLAY.rotation);
|
||||
|
||||
inputs[| 5] = nodeValue("Tile color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, [ new gradientKey(0, c_white) ] )
|
||||
inputs[| 5] = nodeValue("Tile color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, new gradientObject(c_white) )
|
||||
.setDisplay(VALUE_DISPLAY.gradient);
|
||||
|
||||
inputs[| 6] = nodeValue("Gap color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_black);
|
||||
|
@ -69,8 +69,7 @@ function Node_Grid_Tri(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
var _col_gap = _data[6];
|
||||
var _gra = _data[5];
|
||||
|
||||
var _gra_data = inputs[| 5].getExtraData();
|
||||
var _grad = gradient_to_array(_gra);
|
||||
var _grad = _gra.toArray();
|
||||
var _grad_color = _grad[0];
|
||||
var _grad_time = _grad[1];
|
||||
|
||||
|
@ -93,10 +92,10 @@ function Node_Grid_Tri(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
|
||||
shader_set_uniform_f_array_safe(uniform_col_gap, colToVec4(_col_gap));
|
||||
|
||||
shader_set_uniform_i(uniform_grad_blend, ds_list_get(_gra_data, 0));
|
||||
shader_set_uniform_i(uniform_grad_blend, _gra.type);
|
||||
shader_set_uniform_f_array_safe(uniform_grad, _grad_color);
|
||||
shader_set_uniform_f_array_safe(uniform_grad_time, _grad_time);
|
||||
shader_set_uniform_i(uniform_grad_key, array_length(_gra));
|
||||
shader_set_uniform_i(uniform_grad_key, array_length(_gra.keys));
|
||||
|
||||
if(is_surface(_sam))
|
||||
draw_surface_stretched(_sam, 0, 0, _dim[0], _dim[1]);
|
||||
|
|
|
@ -153,7 +153,7 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
break;
|
||||
|
||||
case "Gradient":
|
||||
inParent.animator = new valueAnimator([ new gradientKey(0, c_white) ], inParent);
|
||||
inParent.animator = new valueAnimator(new gradientObject(c_white), inParent);
|
||||
inParent.setDisplay(VALUE_DISPLAY.gradient);
|
||||
break;
|
||||
default: inParent.setDisplay(VALUE_DISPLAY._default); break;
|
||||
|
|
|
@ -21,7 +21,7 @@ function valueKey(_time, _value, _anim = noone, _in = 0, _ot = 0) constructor {
|
|||
ratio = time / (ANIMATOR.frames_total - 1);
|
||||
}
|
||||
|
||||
static clone = function(target) {
|
||||
static clone = function(target = noone) {
|
||||
var key = new valueKey(time, value, target);
|
||||
key.ease_in = ease_in;
|
||||
key.ease_out = ease_out;
|
||||
|
@ -30,6 +30,21 @@ function valueKey(_time, _value, _anim = noone, _in = 0, _ot = 0) constructor {
|
|||
|
||||
return key;
|
||||
}
|
||||
|
||||
static cloneAnimator = function(shift = 0, value = noone, anim = noone) {
|
||||
anim = anim == noone? self.anim : anim;
|
||||
value = value == noone? self.value : value;
|
||||
|
||||
var key = new valueKey(time + shift, value, anim);
|
||||
key.ease_in = ease_in;
|
||||
key.ease_out = ease_out;
|
||||
key.ease_in_type = ease_in_type;
|
||||
key.ease_out_type = ease_out_type;
|
||||
ds_list_add(anim.values, key);
|
||||
anim.setKeyTime(key, time + shift);
|
||||
|
||||
return key;
|
||||
}
|
||||
}
|
||||
|
||||
function valueAnimator(_val, _prop) constructor {
|
||||
|
@ -281,7 +296,9 @@ function valueAnimator(_val, _prop) constructor {
|
|||
_value_list[| 0] = values[| i].time;
|
||||
|
||||
var val = values[| i].value;
|
||||
if(typeArray(prop.display_type) && is_array(val)) {
|
||||
if(is_struct(val)) {
|
||||
_value_list[| 1] = val.serialize();
|
||||
} else 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]) && struct_has(val[j], "serialize"))
|
||||
|
@ -312,19 +329,22 @@ function valueAnimator(_val, _prop) constructor {
|
|||
static deserialize = function(_list, scale = false) {
|
||||
ds_list_clear(values);
|
||||
|
||||
if(prop.type == VALUE_TYPE.color && prop.display_type == VALUE_DISPLAY.gradient && LOADING_VERSION < 1300) { //backward compat: Gradient
|
||||
if(prop.type == VALUE_TYPE.color && prop.display_type == VALUE_DISPLAY.gradient && LOADING_VERSION < SAVEFILE_VERSION) { //backward compat: Gradient
|
||||
var _val = [];
|
||||
var value = _list[| 0][| 1];
|
||||
|
||||
for(var i = 0; i < ds_list_size(_list); i++) {
|
||||
var _keyframe = _list[| i];
|
||||
var time = ds_list_get(_keyframe, 0);
|
||||
var value = ds_list_get(_keyframe, 1);
|
||||
if(ds_exists(value, ds_type_list))
|
||||
for(var i = 0; i < ds_list_size(value); i++) {
|
||||
var _keyframe = value[| i];
|
||||
var _t = ds_map_try_get(_keyframe, "time");
|
||||
var _v = ds_map_try_get(_keyframe, "value");
|
||||
|
||||
array_push(_val, new gradientKey(time, value));
|
||||
array_push(_val, new gradientKey(_t, _v));
|
||||
}
|
||||
|
||||
var vk = new valueKey(0, _val, self);
|
||||
ds_list_add(values, vk);
|
||||
var grad = new gradientObject();
|
||||
grad.keys = _val;
|
||||
ds_list_add(values, new valueKey(0, grad, self));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -353,14 +373,8 @@ function valueAnimator(_val, _prop) constructor {
|
|||
for(var j = 0; j < ds_list_size(value); j++)
|
||||
_val[j] = value[| j];
|
||||
} else if(prop.type == VALUE_TYPE.color && prop.display_type == VALUE_DISPLAY.gradient) {
|
||||
_val = [];
|
||||
|
||||
if(ds_exists(value, ds_type_list)) {
|
||||
for(var j = 0; j < ds_list_size(value); j++) {
|
||||
var gKey = value[| j];
|
||||
_val[j] = new gradientKey(gKey[? "time"], gKey[? "value"]);
|
||||
}
|
||||
}
|
||||
var grad = new gradientObject();
|
||||
_val = grad.deserialize(value);
|
||||
} else if(typeArray(prop.display_type)) {
|
||||
_val = [];
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
|
|||
inputs[| 9] = nodeValue("Shift", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
|
||||
.setDisplay(VALUE_DISPLAY._default, 1 / 64);
|
||||
|
||||
inputs[| 10] = nodeValue("Color over length", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, [ new gradientKey(0, c_white) ] )
|
||||
inputs[| 10] = nodeValue("Color over length", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, new gradientObject(c_white) )
|
||||
.setDisplay(VALUE_DISPLAY.gradient);
|
||||
|
||||
inputs[| 11] = nodeValue("Width over length", self, JUNCTION_CONNECT.input, VALUE_TYPE.curve, CURVE_DEF_11);
|
||||
|
@ -68,7 +68,6 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
|
|||
var _shift = _data[9];
|
||||
|
||||
var _color = _data[10];
|
||||
var _col_data = inputs[| 10].getExtraData();
|
||||
var _widc = _data[11];
|
||||
var _widap = _data[12];
|
||||
|
||||
|
@ -147,7 +146,7 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
|
|||
_na = point_direction(n0[0], n0[1], n1[0], n1[1]) + 90;
|
||||
}
|
||||
|
||||
_nc = gradient_eval(_color, _colP? _prog_eli / _rtLen : _prog_curr, ds_list_get(_col_data, 0));
|
||||
_nc = _color.eval(_colP? _prog_eli / _rtLen : _prog_curr);
|
||||
|
||||
if(_prog_curr > _prog) {
|
||||
if(_cap) {
|
||||
|
@ -210,7 +209,7 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
|
|||
_nw = random_range(_wid[0], _wid[1]);
|
||||
_nw *= eval_curve_x(_widc, _widap? _prog_eli / _rtLen : _prog_curr);
|
||||
|
||||
_nc = gradient_eval(_color, _colP? _prog_eli / _rtLen : _prog_curr, ds_list_get(_col_data, 0));
|
||||
_nc = _color.eval(_colP? _prog_eli / _rtLen : _prog_curr);
|
||||
|
||||
if(_prog_curr > _prog) {
|
||||
if(_cap) {
|
||||
|
|
|
@ -163,6 +163,7 @@ function Node_Math(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
|||
inputs[| 2].setVisible(false);
|
||||
break;
|
||||
case MATH_OPERATOR.lerp :
|
||||
inputs[| 2].setVisible(true);
|
||||
inputs[| 5].setVisible(true);
|
||||
break;
|
||||
default: return;
|
||||
|
|
|
@ -53,7 +53,6 @@ function Node_Particle(_x, _y, _group = noone) : Node_VFX_Spawner_Base(_x, _y, _
|
|||
var _blend = inputs[| input_len + 2].getValue(_time);
|
||||
|
||||
var _outSurf = outputs[| 0].getValue();
|
||||
|
||||
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1]);
|
||||
outputs[| 0].setValue(_outSurf);
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ function Node_Pixel_Cloud(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
|||
|
||||
inputs[| 3] = nodeValue("Strength map", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
|
||||
inputs[| 4] = nodeValue("Color over lifetime", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, [ new gradientKey(0, c_white) ] )
|
||||
inputs[| 4] = nodeValue("Color over lifetime", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, new gradientObject(c_white) )
|
||||
.setDisplay(VALUE_DISPLAY.gradient);
|
||||
|
||||
inputs[| 5] = nodeValue("Distance", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1);
|
||||
|
@ -51,16 +51,13 @@ function Node_Pixel_Cloud(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
|||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var _sed = _data[1];
|
||||
var _str = _data[2];
|
||||
var _map = _data[3];
|
||||
|
||||
var _gra = _data[4];
|
||||
var _gra_data = inputs[| 4].getExtraData();
|
||||
|
||||
var _map = _data[3];
|
||||
var _gra = _data[4];
|
||||
var _dis = _data[5];
|
||||
var _alp = _data[6];
|
||||
var _rnd = _data[7];
|
||||
|
||||
var _grad = gradient_to_array(_gra);
|
||||
var _grad = _gra.toArray();
|
||||
var _grad_color = _grad[0];
|
||||
var _grad_time = _grad[1];
|
||||
|
||||
|
@ -79,10 +76,10 @@ function Node_Pixel_Cloud(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
|||
shader_set_uniform_i(uniform_map_use, 0);
|
||||
}
|
||||
|
||||
shader_set_uniform_i(uniform_grad_blend, ds_list_get(_gra_data, 0));
|
||||
shader_set_uniform_i(uniform_grad_blend, _gra.type);
|
||||
shader_set_uniform_f_array_safe(uniform_grad, _grad_color);
|
||||
shader_set_uniform_f_array_safe(uniform_grad_time, _grad_time);
|
||||
shader_set_uniform_i(uniform_grad_key, array_length(_gra));
|
||||
shader_set_uniform_i(uniform_grad_key, array_length(_gra.keys));
|
||||
|
||||
shader_set_uniform_f_array_safe(uniform_alpha, _alp);
|
||||
shader_set_uniform_i(uniform_alamo, array_length(_alp));
|
||||
|
|
|
@ -5,6 +5,8 @@ enum ARRAY_PROCESS {
|
|||
expand_inv,
|
||||
}
|
||||
|
||||
#macro PROCESSOR_OVERLAY_CHECK if(array_length(current_data) != ds_list_size(inputs)) return;
|
||||
|
||||
function Node_Processor(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||
array_process = ARRAY_PROCESS.loop;
|
||||
current_data = [];
|
||||
|
|
|
@ -409,8 +409,6 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor {
|
|||
addNodeObject(color, "Color", s_node_color_out, "Node_Color", [1, Node_Color]);
|
||||
addNodeObject(color, "RGB Color", s_node_color_from_rgb, "Node_Color_RGB", [1, Node_Color_RGB]);
|
||||
addNodeObject(color, "HSV Color", s_node_color_from_hsv, "Node_Color_HSV", [1, Node_Color_HSV]);
|
||||
addNodeObject(color, "Gradient", s_node_gradient_out, "Node_Gradient_Out", [1, Node_Gradient_Out]);
|
||||
addNodeObject(color, "Gradient Shift", s_node_gradient_shift, "Node_Gradient_Shift", [1, Node_Gradient_Shift]);
|
||||
addNodeObject(color, "Sampler", s_node_sampler, "Node_Sampler", [1, Node_Sampler]);
|
||||
addNodeObject(color, "Color Data", s_node_color_data, "Node_Color_Data", [1, Node_Color_Data]);
|
||||
addNodeObject(color, "Find pixel", s_node_pixel_find, "Node_Find_Pixel", [1, Node_Find_Pixel]).set_version(1130);
|
||||
|
@ -420,6 +418,13 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor {
|
|||
addNodeObject(color, "Sort Palette", s_node_palette_sort, "Node_Palette_Sort", [1, Node_Palette_Sort]).set_version(1130);
|
||||
addNodeObject(color, "Palette Extract", s_node_palette_extract, "Node_Palette_Extract", [1, Node_Palette_Extract]).set_version(1100);
|
||||
addNodeObject(color, "Palette Replace", s_node_palette_replace, "Node_Palette_Replace", [1, Node_Palette_Replace]).set_version(1120);
|
||||
|
||||
ds_list_add(color, "Gradient");
|
||||
addNodeObject(color, "Gradient", s_node_gradient_out, "Node_Gradient_Out", [1, Node_Gradient_Out]);
|
||||
addNodeObject(color, "Gradient Palette", s_node_gradient_palette, "Node_Gradient_Palette", [1, Node_Gradient_Palette]).set_version(1135);
|
||||
addNodeObject(color, "Gradient Shift", s_node_gradient_shift, "Node_Gradient_Shift", [1, Node_Gradient_Shift]);
|
||||
addNodeObject(color, "Gradient Replace", s_node_gradient_replace, "Node_Gradient_Replace_Color", [1, Node_Gradient_Replace_Color]).set_version(1135);
|
||||
addNodeObject(color, "Gradient Data", s_node_gradient_data, "Node_Gradient_Extract", [1, Node_Gradient_Extract]).set_version(1135);
|
||||
|
||||
var animation = ds_list_create();
|
||||
addNodeCatagory("Animation", animation);
|
||||
|
@ -452,7 +457,11 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor {
|
|||
addNodeObject(node, "Tunnel Out", s_node_tunnel_out, "Node_Tunnel_Out", [1, Node_Tunnel_Out]);
|
||||
addNodeObject(node, "Display Text", s_node_text_display,"Node_Display_Text", [1, Node_Display_Text]);
|
||||
addNodeObject(node, "Display Image", s_node_image, "Node_Display_Image", [0, Node_create_Display_Image]);
|
||||
|
||||
|
||||
ds_list_add(node, "Cache");
|
||||
addNodeObject(node, "Cache", s_node_cache, "Node_Cache", [1, Node_Cache]).set_version(1134);
|
||||
addNodeObject(node, "Cache Array", s_node_cache_array, "Node_Cache_Array", [1, Node_Cache_Array]).set_version(1130);
|
||||
|
||||
var hid = ds_list_create();
|
||||
addNodeCatagory("Hidden", hid, ["Hidden"]);
|
||||
addNodeObject(hid, "Input", s_node_feedback_input, "Node_Iterator_Each_Input", [1, Node_Iterator_Each_Input]);
|
||||
|
|
|
@ -39,7 +39,7 @@ function Node_Repeat(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
|
||||
inputs[| 13] = nodeValue("Path shift", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0);
|
||||
|
||||
inputs[| 14] = nodeValue("Color over copy", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, [ new gradientKey(0, c_white) ] )
|
||||
inputs[| 14] = nodeValue("Color over copy", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, new gradientObject(c_white) )
|
||||
.setDisplay(VALUE_DISPLAY.gradient);
|
||||
|
||||
inputs[| 15] = nodeValue("Alpha over copy", self, JUNCTION_CONNECT.input, VALUE_TYPE.curve, CURVE_DEF_11 );
|
||||
|
@ -143,7 +143,6 @@ function Node_Repeat(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
var _prsh = inputs[| 13].getValue();
|
||||
|
||||
var _grad = inputs[| 14].getValue();
|
||||
var _grad_data = inputs[| 14].getExtraData();
|
||||
var _alph = inputs[| 15].getValue();
|
||||
|
||||
var _arr = inputs[| 16].getValue();
|
||||
|
@ -237,7 +236,7 @@ function Node_Repeat(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
}
|
||||
|
||||
var pos = point_rotate(-sw / 2, -sh / 2, 0, 0, rot);
|
||||
var cc = gradient_eval(_grad, i / (_amo - 1), ds_list_get(_grad_data, 0));
|
||||
var cc = _grad.eval(i / (_amo - 1));
|
||||
var aa = eval_curve_x(_alph, i / (_amo - 1));
|
||||
|
||||
cc = merge_color(cc, colorMultiply(cc, _an_bld), _inf);
|
||||
|
|
|
@ -2,6 +2,7 @@ function Node_Rigid_Render(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
name = "Render";
|
||||
color = COLORS.node_blend_simulation;
|
||||
icon = THEME.rigidSim;
|
||||
use_cache = true;
|
||||
|
||||
inputs[| 0] = nodeValue("Render dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, def_surf_size2)
|
||||
.setDisplay(VALUE_DISPLAY.vector)
|
||||
|
@ -19,6 +20,11 @@ function Node_Rigid_Render(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
}
|
||||
if(!LOADING && !APPENDING) createNewInput();
|
||||
|
||||
insp2UpdateTooltip = "Clear cache";
|
||||
insp2UpdateIcon = [ THEME.cache, 0, COLORS._main_icon ];
|
||||
|
||||
static onInspector2Update = function() { clearCache(); }
|
||||
|
||||
static refreshDynamicInput = function() {
|
||||
var _l = ds_list_create();
|
||||
for( var i = 0; i < ds_list_size(inputs); i++ ) {
|
||||
|
@ -45,6 +51,9 @@ function Node_Rigid_Render(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
}
|
||||
|
||||
static update = function(frame = ANIMATOR.current_frame) {
|
||||
if(recoverCache() || !ANIMATOR.is_playing)
|
||||
return;
|
||||
|
||||
var _dim = inputs[| 0].getValue();
|
||||
var _outSurf = outputs[| 0].getValue();
|
||||
|
||||
|
@ -65,7 +74,7 @@ function Node_Rigid_Render(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
if(!is_array(obj)) obj = [ obj ];
|
||||
|
||||
for( var k = 0; k < array_length(obj); k++ ) {
|
||||
var _o = obj[k];
|
||||
var _o = obj[k];
|
||||
if(_o == noone || !instance_exists(_o)) continue;
|
||||
if(is_undefined(_o.phy_active)) continue;
|
||||
|
||||
|
@ -89,6 +98,7 @@ function Node_Rigid_Render(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
}
|
||||
|
||||
surface_reset_target();
|
||||
cacheCurrentFrame(_outSurf);
|
||||
}
|
||||
|
||||
static postDeserialize = function() {
|
||||
|
|
|
@ -17,7 +17,7 @@ function Node_Rigid_Group(_x, _y, _group = noone) : Node_Collection(_x, _y, _gro
|
|||
//physics_world_update_iterations(30);
|
||||
//physics_world_update_speed(100)
|
||||
|
||||
static reset = function() {
|
||||
static reset = function() {
|
||||
instance_destroy(oRigidbody);
|
||||
physics_pause_enable(true);
|
||||
|
||||
|
@ -35,7 +35,7 @@ function Node_Rigid_Group(_x, _y, _group = noone) : Node_Collection(_x, _y, _gro
|
|||
static onStep = function() {
|
||||
RETURN_ON_REST
|
||||
|
||||
if(ANIMATOR.current_frame == 0)
|
||||
if(ANIMATOR.current_frame == 0)
|
||||
reset();
|
||||
|
||||
setRenderStatus(false);
|
||||
|
|
|
@ -30,7 +30,7 @@ function Node_Scatter(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
|||
|
||||
inputs[| 10] = nodeValue("Seed", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, irandom(9999999));
|
||||
|
||||
inputs[| 11] = nodeValue("Random blend", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, [ new gradientKey(0, c_white) ] )
|
||||
inputs[| 11] = nodeValue("Random blend", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, new gradientObject(c_white) )
|
||||
.setDisplay(VALUE_DISPLAY.gradient);
|
||||
|
||||
inputs[| 12] = nodeValue("Alpha", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1 ])
|
||||
|
@ -112,7 +112,6 @@ function Node_Scatter(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
|||
var seed = _data[10];
|
||||
|
||||
var color = _data[11];
|
||||
var _bldTyp = inputs[| 11].getExtraData();
|
||||
var alpha = _data[12];
|
||||
var mulpA = _data[16];
|
||||
var useV = _data[17];
|
||||
|
@ -189,7 +188,7 @@ function Node_Scatter(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
|||
if(vCol && _v != noone)
|
||||
grSamp *= _v;
|
||||
|
||||
var clr = gradient_eval(color, grSamp, _bldTyp[| 0]);
|
||||
var clr = color.eval(grSamp);
|
||||
var alp = random_range_seed(alpha[0], alpha[1], posS); posS++;
|
||||
|
||||
draw_surface_ext_safe(surf, _x, _y, _scx, _scy, _r, clr, alp);
|
||||
|
|
|
@ -35,6 +35,8 @@ function Node_Render_Sprite_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group)
|
|||
|
||||
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
||||
|
||||
refreshSurface = false;
|
||||
|
||||
static step = function() {
|
||||
var grup = inputs[| 1].getValue();
|
||||
var pack = inputs[| 3].getValue();
|
||||
|
@ -51,12 +53,51 @@ function Node_Render_Sprite_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group)
|
|||
var grid = inputs[| 4].getValue();
|
||||
var alig = inputs[| 5].getValue();
|
||||
|
||||
var oupt = outputs[| 0].getValue();
|
||||
|
||||
if(grup != SPRITE_ANIM_GROUP.animation) {
|
||||
onInspectorUpdate();
|
||||
initRender();
|
||||
return;
|
||||
} else if(ANIMATOR.rendering & ANIMATOR.frame_progress && ANIMATOR.current_frame == 0 && !refreshSurface) {
|
||||
var skip = inputs[| 2].getValue();
|
||||
|
||||
if(is_array(inpt) && array_length(inpt) == 0) return;
|
||||
var arr = is_array(inpt);
|
||||
if(!arr) inpt = [ inpt ];
|
||||
var _surf = [];
|
||||
|
||||
for(var i = 0; i < array_length(inpt); i++) {
|
||||
if(!is_surface(inpt[i])) continue;
|
||||
var ww = surface_get_width(inpt[i]);
|
||||
var hh = surface_get_height(inpt[i]);
|
||||
|
||||
switch(pack) {
|
||||
case SPRITE_STACK.horizontal :
|
||||
ww *= floor(ANIMATOR.frames_total / skip);
|
||||
break;
|
||||
case SPRITE_STACK.vertical :
|
||||
hh *= floor(ANIMATOR.frames_total / skip);
|
||||
break;
|
||||
case SPRITE_STACK.grid :
|
||||
var amo = floor(ANIMATOR.frames_total / skip);
|
||||
var col = inputs[| 4].getValue();
|
||||
var row = ceil(amo / col);
|
||||
|
||||
ww *= col;
|
||||
hh *= row;
|
||||
break;
|
||||
}
|
||||
|
||||
_surf[i] = surface_create_valid(ww, hh);
|
||||
surface_set_target(_surf[i]);
|
||||
draw_clear_alpha(0, 0);
|
||||
surface_reset_target();
|
||||
|
||||
refreshSurface = true;
|
||||
}
|
||||
|
||||
if(!arr) _surf = array_safe_get(_surf, 0);
|
||||
outputs[| 0].setValue(_surf);
|
||||
}
|
||||
|
||||
if(safe_mod(ANIMATOR.current_frame, skip) != 0) return;
|
||||
|
||||
if(array_length(anim_drawn) != ANIMATOR.frames_total)
|
||||
|
@ -71,6 +112,7 @@ function Node_Render_Sprite_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group)
|
|||
}
|
||||
}
|
||||
|
||||
var oupt = outputs[| 0].getValue();
|
||||
if(is_array(oupt) && (array_length(inpt) != array_length(oupt))) return;
|
||||
|
||||
var px = 0, py = 0;
|
||||
|
@ -130,6 +172,7 @@ function Node_Render_Sprite_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group)
|
|||
px = _col * _w;
|
||||
py = _row * _h;
|
||||
|
||||
//print(display_name + ": " + string(ANIMATOR.current_frame) + ", " + string(inpt[i]) + "| " + string(px) + ", " + string(py));
|
||||
draw_surface_safe(inpt[i], px, py);
|
||||
break;
|
||||
}
|
||||
|
@ -143,7 +186,7 @@ function Node_Render_Sprite_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group)
|
|||
anim_drawn[ANIMATOR.current_frame] = true;
|
||||
}
|
||||
|
||||
static onInspectorUpdate = function() {
|
||||
static onInspectorUpdate = function(updateAll = true) {
|
||||
var key = ds_map_find_first(NODE_MAP);
|
||||
repeat(ds_map_size(NODE_MAP)) {
|
||||
var node = NODE_MAP[? key];
|
||||
|
@ -156,7 +199,7 @@ function Node_Render_Sprite_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group)
|
|||
}
|
||||
}
|
||||
|
||||
static initRender = function() {
|
||||
static initRender = function() {
|
||||
for(var i = 0; i < array_length(anim_drawn); i++) anim_drawn[i] = false;
|
||||
|
||||
var inpt = inputs[| 0].getValue();
|
||||
|
@ -165,50 +208,13 @@ function Node_Render_Sprite_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group)
|
|||
var alig = inputs[| 5].getValue();
|
||||
|
||||
if(grup == SPRITE_ANIM_GROUP.animation) {
|
||||
refreshSurface = false;
|
||||
if(!LOADING && !APPENDING) {
|
||||
ANIMATOR.setFrame(-1);
|
||||
ANIMATOR.is_playing = true;
|
||||
ANIMATOR.rendering = true;
|
||||
ANIMATOR.frame_progress = true;
|
||||
}
|
||||
|
||||
var skip = inputs[| 2].getValue();
|
||||
|
||||
if(is_array(inpt) && array_length(inpt) == 0) return;
|
||||
var arr = is_array(inpt);
|
||||
if(!arr) inpt = [ inpt ];
|
||||
var _surf = [];
|
||||
|
||||
for(var i = 0; i < array_length(inpt); i++) {
|
||||
if(!is_surface(inpt[i])) continue;
|
||||
var ww = surface_get_width(inpt[i]);
|
||||
var hh = surface_get_height(inpt[i]);
|
||||
|
||||
switch(pack) {
|
||||
case SPRITE_STACK.horizontal :
|
||||
ww *= floor(ANIMATOR.frames_total / skip);
|
||||
break;
|
||||
case SPRITE_STACK.vertical :
|
||||
hh *= floor(ANIMATOR.frames_total / skip);
|
||||
break;
|
||||
case SPRITE_STACK.grid :
|
||||
var amo = floor(ANIMATOR.frames_total / skip);
|
||||
var col = inputs[| 4].getValue();
|
||||
var row = ceil(amo / col);
|
||||
|
||||
ww *= col;
|
||||
hh *= row;
|
||||
break;
|
||||
}
|
||||
|
||||
_surf[i] = surface_create_valid(ww, hh);
|
||||
surface_set_target(_surf[i]);
|
||||
draw_clear_alpha(0, 0);
|
||||
surface_reset_target();
|
||||
}
|
||||
|
||||
if(!arr) _surf = array_safe_get(_surf, 0);
|
||||
outputs[| 0].setValue(_surf);
|
||||
} else {
|
||||
if(is_array(inpt)) {
|
||||
if(array_length(inpt) == 0) return;
|
||||
|
|
|
@ -38,7 +38,7 @@ function Node_Stripe(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
|||
|
||||
inputs[| 6] = nodeValue("Random color", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false);
|
||||
|
||||
inputs[| 7] = nodeValue("Colors", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, [ new gradientKey(0, c_white) ] )
|
||||
inputs[| 7] = nodeValue("Colors", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, new gradientObject(c_white) )
|
||||
.setDisplay(VALUE_DISPLAY.gradient);
|
||||
|
||||
inputs[| 8] = nodeValue("Color 1", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_white);
|
||||
|
@ -79,9 +79,8 @@ function Node_Stripe(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
|||
inputs[| 9].setVisible(!_grad_use);
|
||||
|
||||
var _gra = _data[7];
|
||||
var _gra_data = inputs[| 7].getExtraData();
|
||||
|
||||
var _g = gradient_to_array(_gra);
|
||||
var _g = _gra.toArray();
|
||||
var _grad_color = _g[0];
|
||||
var _grad_time = _g[1];
|
||||
|
||||
|
@ -100,10 +99,10 @@ function Node_Stripe(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
|||
shader_set_uniform_f_array_safe(uniform_clr1, colToVec4(_clr1));
|
||||
|
||||
shader_set_uniform_i(uniform_grad_use, _grad_use);
|
||||
shader_set_uniform_i(uniform_grad_blend, ds_list_get(_gra_data, 0));
|
||||
shader_set_uniform_i(uniform_grad_blend, _gra.type);
|
||||
shader_set_uniform_f_array_safe(uniform_grad, _grad_color);
|
||||
shader_set_uniform_f_array_safe(uniform_grad_time, _grad_time);
|
||||
shader_set_uniform_i(uniform_grad_key, array_length(_gra));
|
||||
shader_set_uniform_i(uniform_grad_key, array_length(_gra.keys));
|
||||
|
||||
draw_sprite_ext(s_fx_pixel, 0, 0, 0, _dim[0], _dim[1], 0, c_white, 1);
|
||||
shader_reset();
|
||||
|
|
|
@ -13,6 +13,14 @@ function Node_Tunnel_In(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
|||
|
||||
error_notification = noone;
|
||||
|
||||
insp2UpdateTooltip = "Create tunnel out";
|
||||
insp2UpdateIcon = [ THEME.tunnel, 0, c_white ];
|
||||
|
||||
static onInspector2Update = function() {
|
||||
var n = nodeBuild("Node_Tunnel_Out", x + 128, y);
|
||||
n.inputs[| 0].setValue(inputs[| 0].getValue());
|
||||
}
|
||||
|
||||
static onDrawNodeBehind = function(_x, _y, _mx, _my, _s) {
|
||||
var xx = _x + x * _s;
|
||||
var yy = _y + y * _s;
|
||||
|
@ -30,7 +38,11 @@ function Node_Tunnel_In(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
|||
|
||||
draw_set_color(COLORS.node_blend_tunnel);
|
||||
draw_set_alpha(0.35);
|
||||
draw_line_width(xx + w * _s / 2, yy + h * _s / 2, _x + (node.x + node.w / 2) * _s, _y + (node.y + node.h / 2) * _s, 6 * _s);
|
||||
var frx = xx + w * _s / 2;
|
||||
var fry = yy + h * _s / 2;
|
||||
var tox = _x + (node.x + node.w / 2) * _s;
|
||||
var toy = _y + (node.y + node.h / 2) * _s;
|
||||
draw_line_dashed(frx, fry, tox, toy, 8 * _s, 16 * _s, current_time / 100);
|
||||
draw_set_alpha(1);
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,11 @@ function Node_Tunnel_Out(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
|||
|
||||
draw_set_color(COLORS.node_blend_tunnel);
|
||||
draw_set_alpha(0.35);
|
||||
draw_line_width(xx + w * _s / 2, yy + h * _s / 2, _x + (node.x + node.w / 2) * _s, _y + (node.y + node.h / 2) * _s, 6 * _s);
|
||||
var frx = _x + (node.x + node.w / 2) * _s;
|
||||
var fry = _y + (node.y + node.h / 2) * _s;
|
||||
var tox = xx + w * _s / 2;
|
||||
var toy = yy + h * _s / 2;
|
||||
draw_line_dashed(frx, fry, tox, toy, 8 * _s, 16 * _s, current_time / 100);
|
||||
draw_set_alpha(1);
|
||||
}
|
||||
|
||||
|
|
|
@ -157,7 +157,6 @@ function typeArray(_type) {
|
|||
|
||||
case VALUE_DISPLAY.path_array :
|
||||
case VALUE_DISPLAY.palette :
|
||||
case VALUE_DISPLAY.gradient :
|
||||
case VALUE_DISPLAY.text_array :
|
||||
return 1;
|
||||
}
|
||||
|
@ -332,6 +331,10 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
extra_data = ds_list_create();
|
||||
dyna_depo = ds_list_create();
|
||||
|
||||
draw_line_shift_x = 0;
|
||||
draw_line_shift_y = 0;
|
||||
draw_line_shift_hover = false;
|
||||
|
||||
visible = _connect == JUNCTION_CONNECT.output || _type == VALUE_TYPE.surface || _type == VALUE_TYPE.path;
|
||||
show_in_inspector = true;
|
||||
|
||||
|
@ -777,10 +780,12 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
var grad = array_create(amo);
|
||||
for( var i = 0; i < amo; i++ )
|
||||
grad[i] = new gradientKey(i / amo, value[i]);
|
||||
return grad;
|
||||
var g = new gradientObject();
|
||||
g.keys = grad;
|
||||
return g;
|
||||
}
|
||||
|
||||
var grad = [ new gradientKey(0, value) ];
|
||||
var grad = new gradientObject(value);
|
||||
return grad;
|
||||
}
|
||||
|
||||
|
@ -827,10 +832,10 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
}
|
||||
|
||||
if(typeFrom == VALUE_TYPE.integer && type == VALUE_TYPE.color)
|
||||
return make_color_hsv(0, 0, value);
|
||||
return value;
|
||||
|
||||
if((typeFrom == VALUE_TYPE.float || typeFrom == VALUE_TYPE.boolean) && type == VALUE_TYPE.color)
|
||||
return make_color_hsv(0, 0, value * 255);
|
||||
if((typeFrom == VALUE_TYPE.integer || typeFrom == VALUE_TYPE.float || typeFrom == VALUE_TYPE.boolean) && type == VALUE_TYPE.color)
|
||||
return value >= 1? value : make_color_hsv(0, 0, value * 255);
|
||||
|
||||
if(typeFrom == VALUE_TYPE.boolean && type == VALUE_TYPE.text)
|
||||
return value? "true" : "false";
|
||||
|
@ -1022,9 +1027,9 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
node.triggerRender();
|
||||
if(_update)
|
||||
node.valueUpdate(index);
|
||||
node.clearCacheForward();
|
||||
}
|
||||
|
||||
node.clearCacheForward();
|
||||
cache_array[0] = false;
|
||||
cache_value[0] = false;
|
||||
}
|
||||
|
@ -1119,6 +1124,9 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
cache_array[0] = false;
|
||||
cache_value[0] = false;
|
||||
|
||||
draw_line_shift_x = 0;
|
||||
draw_line_shift_y = 0;
|
||||
|
||||
if(!LOADING) MODIFIED = true;
|
||||
return true;
|
||||
}
|
||||
|
@ -1356,10 +1364,12 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
|
||||
ds_map_add_list(_map, "raw value", animator.serialize(scale));
|
||||
|
||||
_map[? "on end"] = on_end;
|
||||
_map[? "visible"] = visible;
|
||||
_map[? "unit"] = unit.mode;
|
||||
_map[? "anim"] = animator.is_anim;
|
||||
_map[? "on end"] = on_end;
|
||||
_map[? "visible"] = visible;
|
||||
_map[? "unit"] = unit.mode;
|
||||
_map[? "anim"] = animator.is_anim;
|
||||
_map[? "shift x"] = draw_line_shift_x;
|
||||
_map[? "shift y"] = draw_line_shift_y;
|
||||
_map[? "from node"] = !preset && value_from? value_from.node.node_id : -1;
|
||||
_map[? "from index"] = !preset && value_from? value_from.index : -1;
|
||||
|
||||
|
@ -1376,9 +1386,11 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
if(_map == noone) return;
|
||||
|
||||
printIf(TESTING, " |- Applying deserialize to junction " + name + " of node " + node.name);
|
||||
on_end = ds_map_try_get(_map, "on end", on_end);
|
||||
visible = ds_map_try_get(_map, "visible", visible);
|
||||
unit.mode = ds_map_try_get(_map, "unit", VALUE_UNIT.constant);
|
||||
on_end = ds_map_try_get(_map, "on end", on_end);
|
||||
visible = ds_map_try_get(_map, "visible", visible);
|
||||
unit.mode = ds_map_try_get(_map, "unit", VALUE_UNIT.constant);
|
||||
draw_line_shift_x = ds_map_try_get(_map, "shift x");
|
||||
draw_line_shift_y = ds_map_try_get(_map, "shift y");
|
||||
|
||||
animator.deserialize(_map[? "raw value"], scale);
|
||||
|
||||
|
|
|
@ -79,8 +79,11 @@ function Panel_Animation() : PanelContent() constructor {
|
|||
addHotkey("", "Play/Pause", vk_space, MOD_KEY.none, function() {
|
||||
ANIMATOR.is_playing = !ANIMATOR.is_playing;
|
||||
ANIMATOR.frame_progress = true;
|
||||
if(ANIMATOR.is_playing && ANIMATOR.frames_total)
|
||||
ANIMATOR.time_since_last_frame = 0;
|
||||
|
||||
if(ANIMATOR.is_playing && ANIMATOR.frames_total)
|
||||
ANIMATOR.setFrame(0);
|
||||
|
||||
});
|
||||
addHotkey("", "First frame", vk_home, MOD_KEY.none, function() { ANIMATOR.setFrame(0); });
|
||||
addHotkey("", "Last frame", vk_end, MOD_KEY.none, function() { ANIMATOR.setFrame(ANIMATOR.frames_total - 1); });
|
||||
|
@ -90,7 +93,10 @@ function Panel_Animation() : PanelContent() constructor {
|
|||
addHotkey("", "Previous frame", vk_left, MOD_KEY.none, function() {
|
||||
ANIMATOR.setFrame(max(ANIMATOR.real_frame - 1, 0));
|
||||
});
|
||||
addHotkey("Animation", "Delete keys", vk_delete, MOD_KEY.none, function() { deleteKeys(); });
|
||||
addHotkey("Animation", "Delete keys", vk_delete, MOD_KEY.none, function() { deleteKeys(); });
|
||||
addHotkey("Animation", "Duplicate", "D", MOD_KEY.ctrl, function() { doDuplicate(); });
|
||||
addHotkey("Animation", "Copy", "C", MOD_KEY.ctrl, function() { doCopy(); });
|
||||
addHotkey("Animation", "Paste", "V", MOD_KEY.ctrl, function() { doPaste(); });
|
||||
|
||||
function deleteKeys() {
|
||||
for( var i = 0; i < ds_list_size(keyframe_selecting); i++ ) {
|
||||
|
@ -98,6 +104,7 @@ function Panel_Animation() : PanelContent() constructor {
|
|||
k.anim.removeKey(k);
|
||||
}
|
||||
ds_list_clear(keyframe_selecting);
|
||||
updatePropertyList();
|
||||
}
|
||||
|
||||
function alignKeys(halign = fa_left) {
|
||||
|
@ -239,7 +246,10 @@ function Panel_Animation() : PanelContent() constructor {
|
|||
]),
|
||||
menuItem(get_text("panel_animation_stagger", "Stagger"), function() { stagger_mode = 1; }),
|
||||
-1,
|
||||
menuItem(get_text("delete", "Delete"), function() { deleteKeys(); }, noone, [ "Animation", "Delete keys" ]),
|
||||
menuItem(get_text("delete", "Delete"), function() { deleteKeys(); }, noone, [ "Animation", "Delete keys" ]),
|
||||
menuItem(get_text("duplicate", "Duplicate"), function() { doDuplicate(); }, THEME.duplicate, [ "Animation", "Duplicate" ]),
|
||||
menuItem(get_text("copy", "Copy"), function() { doCopy(); }, THEME.copy, [ "Animation", "Copy" ]),
|
||||
menuItem(get_text("paste", "Paste"), function() { doPaste(); }, THEME.paste, [ "Animation", "Paste" ]),
|
||||
];
|
||||
|
||||
function onResize() {
|
||||
|
@ -1091,6 +1101,77 @@ function Panel_Animation() : PanelContent() constructor {
|
|||
if(mouse_release(mb_left))
|
||||
keyframe_boxing = false;
|
||||
}
|
||||
#region drag key
|
||||
if(keyframe_dragging) {
|
||||
if(keyframe_drag_type == KEYFRAME_DRAG_TYPE.move) {
|
||||
var tt = round((mx - bar_x - timeline_shift) / ui(timeline_scale)) - 1;
|
||||
tt = max(tt, 0);
|
||||
var sh = tt - keyframe_dragging.time;
|
||||
|
||||
for( var i = 0; i < ds_list_size(keyframe_selecting); i++ ) {
|
||||
var k = keyframe_selecting[| i];
|
||||
var kt = k.time + sh;
|
||||
|
||||
k.anim.setKeyTime(k, kt, false);
|
||||
}
|
||||
|
||||
timeline_show_time = floor(tt);
|
||||
|
||||
if(mouse_release(mb_left) || mouse_press(mb_left)) {
|
||||
keyframe_dragging = noone;
|
||||
|
||||
for( var i = 0; i < ds_list_size(keyframe_selecting); i++ ) {
|
||||
var k = keyframe_selecting[| i];
|
||||
k.anim.setKeyTime(k, k.time);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var dx = abs((keyframe_dragging.time + 1) - (mx - bar_x - timeline_shift) / ui(timeline_scale)) / 2;
|
||||
dx = clamp(dx, 0, 1);
|
||||
if(dx > 0.2) keyframe_dragout = true;
|
||||
|
||||
var dy = (my - keyframe_drag_my) / 32;
|
||||
|
||||
var _in = keyframe_dragging.ease_in;
|
||||
var _ot = keyframe_dragging.ease_out;
|
||||
|
||||
switch(keyframe_drag_type) {
|
||||
case KEYFRAME_DRAG_TYPE.ease_in :
|
||||
for( var i = 0; i < ds_list_size(keyframe_selecting); i++ ) {
|
||||
var k = keyframe_selecting[| i];
|
||||
k.ease_in_type = keyframe_dragout? CURVE_TYPE.bezier : CURVE_TYPE.none;
|
||||
k.ease_in[0] = dx;
|
||||
}
|
||||
|
||||
break;
|
||||
case KEYFRAME_DRAG_TYPE.ease_out :
|
||||
for( var i = 0; i < ds_list_size(keyframe_selecting); i++ ) {
|
||||
var k = keyframe_selecting[| i];
|
||||
k.ease_out_type = keyframe_dragout? CURVE_TYPE.bezier : CURVE_TYPE.none;
|
||||
k.ease_out[0] = dx;
|
||||
}
|
||||
break;
|
||||
case KEYFRAME_DRAG_TYPE.ease_both :
|
||||
for( var i = 0; i < ds_list_size(keyframe_selecting); i++ ) {
|
||||
var k = keyframe_selecting[| i];
|
||||
k.ease_in_type = keyframe_dragout? CURVE_TYPE.bezier : CURVE_TYPE.none;
|
||||
k.ease_out_type = keyframe_dragout? CURVE_TYPE.bezier : CURVE_TYPE.none;
|
||||
|
||||
k.ease_in[0] = dx;
|
||||
k.ease_out[0] = dx;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if(mouse_release(mb_left)) {
|
||||
recordAction(ACTION_TYPE.var_modify, keyframe_dragging, [_in, "ease_in"]);
|
||||
recordAction(ACTION_TYPE.var_modify, keyframe_dragging, [_ot, "ease_out"]);
|
||||
|
||||
keyframe_dragging = noone;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region draw keys
|
||||
for( var i = 0; i < ds_list_size(anim_properties); i++ ) {
|
||||
|
@ -1205,77 +1286,7 @@ function Panel_Animation() : PanelContent() constructor {
|
|||
if(!ds_list_empty(keyframe_selecting))
|
||||
menuCall(,, keyframe_menu);
|
||||
}
|
||||
|
||||
if(keyframe_dragging) {
|
||||
if(keyframe_drag_type == KEYFRAME_DRAG_TYPE.move) {
|
||||
var tt = round((mx - bar_x - timeline_shift) / ui(timeline_scale)) - 1;
|
||||
tt = max(tt, 0);
|
||||
var sh = tt - keyframe_dragging.time;
|
||||
|
||||
for( var i = 0; i < ds_list_size(keyframe_selecting); i++ ) {
|
||||
var k = keyframe_selecting[| i];
|
||||
var kt = k.time + sh;
|
||||
|
||||
k.anim.setKeyTime(k, kt, false);
|
||||
}
|
||||
|
||||
timeline_show_time = floor(tt);
|
||||
|
||||
if(mouse_release(mb_left)) {
|
||||
keyframe_dragging = noone;
|
||||
|
||||
for( var i = 0; i < ds_list_size(keyframe_selecting); i++ ) {
|
||||
var k = keyframe_selecting[| i];
|
||||
k.anim.setKeyTime(k, k.time);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var dx = abs((keyframe_dragging.time + 1) - (mx - bar_x - timeline_shift) / ui(timeline_scale)) / 2;
|
||||
dx = clamp(dx, 0, 1);
|
||||
if(dx > 0.2) keyframe_dragout = true;
|
||||
|
||||
var dy = (my - keyframe_drag_my) / 32;
|
||||
|
||||
var _in = keyframe_dragging.ease_in;
|
||||
var _ot = keyframe_dragging.ease_out;
|
||||
|
||||
switch(keyframe_drag_type) {
|
||||
case KEYFRAME_DRAG_TYPE.ease_in :
|
||||
for( var i = 0; i < ds_list_size(keyframe_selecting); i++ ) {
|
||||
var k = keyframe_selecting[| i];
|
||||
k.ease_in_type = keyframe_dragout? CURVE_TYPE.bezier : CURVE_TYPE.none;
|
||||
k.ease_in[0] = dx;
|
||||
}
|
||||
|
||||
break;
|
||||
case KEYFRAME_DRAG_TYPE.ease_out :
|
||||
for( var i = 0; i < ds_list_size(keyframe_selecting); i++ ) {
|
||||
var k = keyframe_selecting[| i];
|
||||
k.ease_out_type = keyframe_dragout? CURVE_TYPE.bezier : CURVE_TYPE.none;
|
||||
k.ease_out[0] = dx;
|
||||
}
|
||||
break;
|
||||
case KEYFRAME_DRAG_TYPE.ease_both :
|
||||
for( var i = 0; i < ds_list_size(keyframe_selecting); i++ ) {
|
||||
var k = keyframe_selecting[| i];
|
||||
k.ease_in_type = keyframe_dragout? CURVE_TYPE.bezier : CURVE_TYPE.none;
|
||||
k.ease_out_type = keyframe_dragout? CURVE_TYPE.bezier : CURVE_TYPE.none;
|
||||
|
||||
k.ease_in[0] = dx;
|
||||
k.ease_out[0] = dx;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if(mouse_release(mb_left)) {
|
||||
recordAction(ACTION_TYPE.var_modify, keyframe_dragging, [_in, "ease_in"]);
|
||||
recordAction(ACTION_TYPE.var_modify, keyframe_dragging, [_ot, "ease_out"]);
|
||||
|
||||
keyframe_dragging = noone;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(stagger_mode == 2) {
|
||||
var ts = keyframe_selecting[| stagger_index].time;
|
||||
var tm = round((mx - bar_x - timeline_shift) / ui(timeline_scale)) - 1;
|
||||
|
@ -1390,4 +1401,41 @@ function Panel_Animation() : PanelContent() constructor {
|
|||
timeline_show_time = -1;
|
||||
}
|
||||
}
|
||||
|
||||
function doDuplicate() {
|
||||
if(ds_list_empty(keyframe_selecting)) return;
|
||||
|
||||
var clones = ds_list_create();
|
||||
for( var i = 0; i < ds_list_size(keyframe_selecting); i++ ) {
|
||||
ds_list_add(clones, keyframe_selecting[| i].cloneAnimator());
|
||||
}
|
||||
|
||||
ds_list_destroy(keyframe_selecting);
|
||||
keyframe_selecting = clones;
|
||||
|
||||
keyframe_dragging = keyframe_selecting[| 0];
|
||||
keyframe_drag_type = KEYFRAME_DRAG_TYPE.move;
|
||||
keyframe_drag_mx = mx;
|
||||
keyframe_drag_my = my;
|
||||
}
|
||||
|
||||
copy_clipboard = ds_list_create();
|
||||
function doCopy() {
|
||||
ds_list_clear(copy_clipboard);
|
||||
for( var i = 0; i < ds_list_size(keyframe_selecting); i++ )
|
||||
ds_list_add(copy_clipboard, keyframe_selecting[| i]);
|
||||
}
|
||||
|
||||
function doPaste() {
|
||||
if(ds_list_empty(copy_clipboard)) return;
|
||||
|
||||
var shf = 0;
|
||||
var minx = ANIMATOR.frames_total + 2;
|
||||
for( var i = 0; i < ds_list_size(copy_clipboard); i++ )
|
||||
minx = min(minx, copy_clipboard[| i].time);
|
||||
shf = ANIMATOR.current_frame - minx; print(minx);
|
||||
|
||||
for( var i = 0; i < ds_list_size(copy_clipboard); i++ )
|
||||
copy_clipboard[| i].cloneAnimator(shf);
|
||||
}
|
||||
}
|
|
@ -51,6 +51,10 @@ function Panel_Graph() : PanelContent() constructor {
|
|||
nodes_select_mx = 0;
|
||||
nodes_select_my = 0;
|
||||
|
||||
nodes_junction_d = noone;
|
||||
nodes_junction_dx = 0;
|
||||
nodes_junction_dy = 0;
|
||||
|
||||
node_hovering = noone;
|
||||
node_hover = noone;
|
||||
node_focus = noone;
|
||||
|
@ -202,7 +206,7 @@ function Panel_Graph() : PanelContent() constructor {
|
|||
|
||||
addHotkey("Graph", "Duplicate", "D", MOD_KEY.ctrl, function() { doDuplicate(); });
|
||||
addHotkey("Graph", "Copy", "C", MOD_KEY.ctrl, function() { doCopy(); });
|
||||
addHotkey("Graph", "Paste", "V", MOD_KEY.ctrl, function() { doPaste(clipboard_get_text()); });
|
||||
addHotkey("Graph", "Paste", "V", MOD_KEY.ctrl, function() { doPaste(); });
|
||||
|
||||
function stepBegin() {
|
||||
var gr_x = graph_x * graph_s;
|
||||
|
@ -536,21 +540,18 @@ function Panel_Graph() : PanelContent() constructor {
|
|||
menuCall(,, menu );
|
||||
} else {
|
||||
var menu = [];
|
||||
if(node_focus != noone || ds_list_size(nodes_select_list)) {
|
||||
array_push(menu,
|
||||
menuItem(get_text("copy", "Copy"), function() {
|
||||
doCopy();
|
||||
}, THEME.copy, ["Graph", "Copy"])
|
||||
);
|
||||
}
|
||||
|
||||
if(clipboard_get_text() != "") {
|
||||
array_push(menu,
|
||||
menuItem(get_text("paste", "Paste"), function() {
|
||||
doPaste(clipboard_get_text());
|
||||
}, THEME.paste, ["Graph", "Paste"])
|
||||
);
|
||||
}
|
||||
array_push(menu,
|
||||
menuItem(get_text("copy", "Copy"), function() {
|
||||
doCopy();
|
||||
}, THEME.copy, ["Graph", "Copy"]).setActive(node_focus != noone || ds_list_size(nodes_select_list))
|
||||
);
|
||||
|
||||
array_push(menu,
|
||||
menuItem(get_text("paste", "Paste"), function() {
|
||||
doPaste();
|
||||
}, THEME.paste, ["Graph", "Paste"]).setActive(clipboard_get_text() != "")
|
||||
);
|
||||
|
||||
callAddDialog();
|
||||
menuCall(o_dialog_add_node.dialog_x - ui(8), o_dialog_add_node.dialog_y + ui(4), menu, fa_right );
|
||||
|
@ -586,10 +587,12 @@ function Panel_Graph() : PanelContent() constructor {
|
|||
|
||||
#region draw node
|
||||
//var t = current_time;
|
||||
for(var i = 0; i < ds_list_size(nodes_list); i++)
|
||||
nodes_list[| i].onDrawNodeBehind(gr_x, gr_y, mx, my, graph_s);
|
||||
|
||||
for(var i = 0; i < ds_list_size(nodes_list); i++) {
|
||||
var n = nodes_list[| i];
|
||||
if(instanceof(n) == "Node_Frame") continue;
|
||||
n.onDrawNodeBehind(gr_x, gr_y, mx, my, graph_s);
|
||||
var val = n.drawNode(gr_x, gr_y, mx, my, graph_s);
|
||||
|
||||
if(val) {
|
||||
|
@ -774,9 +777,29 @@ function Panel_Graph() : PanelContent() constructor {
|
|||
if(mouse_release(mb_left))
|
||||
nodes_select_drag = false;
|
||||
}
|
||||
|
||||
if(nodes_junction_d != noone) {
|
||||
var shx = nodes_junction_dx + (mx - nodes_select_mx) / graph_s;
|
||||
var shy = nodes_junction_dy + (my - nodes_select_my) / graph_s;
|
||||
|
||||
shx = value_snap(shx, key_mod_press(CTRL)? 1 : 4);
|
||||
shy = value_snap(shy, key_mod_press(CTRL)? 1 : 4);
|
||||
|
||||
nodes_junction_d.draw_line_shift_x = shx;
|
||||
nodes_junction_d.draw_line_shift_y = shy;
|
||||
|
||||
if(mouse_release(mb_left))
|
||||
nodes_junction_d = noone;
|
||||
}
|
||||
|
||||
if(mouse_on_graph && mouse_press(mb_left, pFOCUS) && !key_mod_press(ALT)) {
|
||||
if(!node_focus && !value_focus && !drag_locking) {
|
||||
if(junction_hovering && junction_hovering.draw_line_shift_hover) {
|
||||
nodes_select_mx = mx;
|
||||
nodes_select_my = my;
|
||||
nodes_junction_d = junction_hovering;
|
||||
nodes_junction_dx = junction_hovering.draw_line_shift_x;
|
||||
nodes_junction_dy = junction_hovering.draw_line_shift_y;
|
||||
} else if(!node_focus && !value_focus && !drag_locking) {
|
||||
nodes_select_drag = true;
|
||||
nodes_select_mx = mx;
|
||||
nodes_select_my = my;
|
||||
|
@ -878,7 +901,8 @@ function Panel_Graph() : PanelContent() constructor {
|
|||
ds_map_destroy(_map);
|
||||
}
|
||||
|
||||
function doPaste(txt = "") {
|
||||
function doPaste() {
|
||||
var txt = clipboard_get_text();
|
||||
var _map = json_decode(txt);
|
||||
if(_map != -1) {
|
||||
ds_map_clear(APPEND_MAP);
|
||||
|
|
|
@ -409,7 +409,7 @@ function Panel_Inspector() : PanelContent() constructor {
|
|||
case VALUE_TYPE.color :
|
||||
switch(jun.display_type) {
|
||||
case VALUE_DISPLAY.gradient :
|
||||
jun.editWidget.draw(editBoxX, editBoxY, editBoxW, editBoxH, jun.showValue(), jun.extra_data, _m);
|
||||
jun.editWidget.draw(editBoxX, editBoxY, editBoxW, editBoxH, jun.showValue(), _m);
|
||||
break;
|
||||
default :
|
||||
jun.editWidget.draw(editBoxX, editBoxY, editBoxW, editBoxH, jun.showValue(), _m);
|
||||
|
@ -703,16 +703,18 @@ function Panel_Inspector() : PanelContent() constructor {
|
|||
var bx = w - ui(44);
|
||||
var by = ui(12);
|
||||
|
||||
if(inspecting.hasInspectorUpdate()) {
|
||||
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, inspecting.inspUpdateTooltip, inspecting.inspUpdateIcon[0], inspecting.inspUpdateIcon[1], inspecting.inspUpdateIcon[2]) == 2)
|
||||
if(inspecting.hasInspectorUpdate(true)) {
|
||||
var icon = inspecting.inspUpdateIcon;
|
||||
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, inspecting.inspUpdateTooltip, icon[0], icon[1], icon[2]) == 2)
|
||||
inspecting.inspectorUpdate();
|
||||
} else
|
||||
draw_sprite_ui(THEME.sequence_control, 1, bx + ui(16), by + ui(16),,,, COLORS._main_icon_dark);
|
||||
|
||||
if(inspecting.hasInspector2Update()) {
|
||||
by += ui(36);
|
||||
var icon = inspecting.insp2UpdateIcon;
|
||||
|
||||
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, inspecting.insp2UpdateTooltip, inspecting.insp2UpdateIcon[0], inspecting.insp2UpdateIcon[1], inspecting.insp2UpdateIcon[2]) = 2)
|
||||
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, inspecting.insp2UpdateTooltip, icon[0], icon[1], icon[2]) = 2)
|
||||
inspecting.inspector2Update();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,8 @@ function Panel_Menu() : PanelContent() constructor {
|
|||
noti_icon_show = 0;
|
||||
noti_icon_time = 0;
|
||||
|
||||
|
||||
|
||||
menu_file = [
|
||||
menuItem(get_text("panel_menu_new", "New"), function() { NEW(); }, THEME.new_file, ["", "New file"]),
|
||||
menuItem(get_text("panel_menu_open", "Open") + "...", function() { LOAD(); }, THEME.noti_icon_file_load, ["", "Open"]),
|
||||
|
@ -34,7 +36,8 @@ function Panel_Menu() : PanelContent() constructor {
|
|||
}
|
||||
|
||||
instance_create_depth(0, 0, 0, addon_key_displayer);
|
||||
})
|
||||
}),
|
||||
|
||||
]);
|
||||
}, THEME.addon ).setIsShelf(),
|
||||
-1,
|
||||
|
@ -301,22 +304,21 @@ function Panel_Menu() : PanelContent() constructor {
|
|||
nx0 += nw + ui(8);
|
||||
#endregion
|
||||
|
||||
#region window
|
||||
#region addons
|
||||
var wh = ui(32);
|
||||
var cc = c_white;
|
||||
|
||||
with(addon) {
|
||||
draw_set_text(f_p0, fa_center, fa_center, COLORS._main_text);
|
||||
var ww = string_width(name) + ui(16);
|
||||
|
||||
if(other.pHOVER && point_in_rectangle(other.mx, other.my, nx0, ny0 - wh / 2, nx0 + ww, ny0 + wh / 2)) {
|
||||
draw_sprite_stretched_ext(THEME.menu_button, 1, nx0, ny0 - wh / 2, ww, wh, cc, 1);
|
||||
draw_sprite_stretched(THEME.menu_button, 1, nx0, ny0 - wh / 2, ww, wh);
|
||||
if(mouse_press(mb_left, other.pFOCUS))
|
||||
instance_destroy();
|
||||
if(mouse_press(mb_right, other.pFOCUS))
|
||||
menuCall(,, menu);
|
||||
} else
|
||||
draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, nx0, ny0 - wh / 2, ww, wh, cc, 1);
|
||||
draw_sprite_stretched(THEME.ui_panel_bg, 1, nx0, ny0 - wh / 2, ww, wh);
|
||||
draw_text(nx0 + ww / 2, ny0, name);
|
||||
|
||||
nx0 += ww + ui(4);
|
||||
|
|
|
@ -59,6 +59,8 @@
|
|||
|
||||
PREF_MAP[? "dialog_add_node_w"] = 532;
|
||||
PREF_MAP[? "dialog_add_node_h"] = 400;
|
||||
|
||||
PREF_MAP[? "panel_menu_resource_monitor"] = false;
|
||||
#endregion
|
||||
|
||||
#region hotkeys
|
||||
|
|
|
@ -4,7 +4,7 @@ enum RENDER_TYPE {
|
|||
full = 2
|
||||
}
|
||||
|
||||
global.RENDER_LOG = false;
|
||||
global.RENDER_LOG = false;
|
||||
global.group_inputs = [ "Node_Group_Input", "Node_Feedback_Input", "Node_Iterator_Input", "Node_Iterator_Each_Input" ];
|
||||
|
||||
function __nodeLeafList(_list, _queue) {
|
||||
|
@ -40,7 +40,7 @@ function __nodeInLoop(_node) {
|
|||
return false;
|
||||
}
|
||||
|
||||
function Render(partial = false) {
|
||||
function Render(partial = false, runAction = false) {
|
||||
try {
|
||||
var rendering = noone;
|
||||
var error = 0;
|
||||
|
@ -78,7 +78,7 @@ function Render(partial = false) {
|
|||
var _startNode = _node.isRenderable();
|
||||
if(_startNode) {
|
||||
ds_queue_enqueue(RENDER_QUEUE, _node);
|
||||
printIf(global.RENDER_LOG, " > Push " + _node.name + " node to stack");
|
||||
printIf(global.RENDER_LOG, " > Push " + _node.name + " (" + _node.display_name + ") node to stack");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -86,13 +86,76 @@ function Render(partial = false) {
|
|||
while(!ds_queue_empty(RENDER_QUEUE)) {
|
||||
rendering = ds_queue_dequeue(RENDER_QUEUE);
|
||||
|
||||
var txt = rendering.rendered? " [Skip]" : " [Update]";
|
||||
if(!rendering.rendered) {
|
||||
rendering.doUpdate();
|
||||
rendering.setRenderStatus(true);
|
||||
printIf(global.RENDER_LOG, "Rendered " + rendering.name + " (" + rendering.display_name + ") [" + string(instanceof(rendering)) + "] (Update)");
|
||||
|
||||
rendering.getNextNodes();
|
||||
|
||||
if(runAction && rendering.hasInspectorUpdate())
|
||||
rendering.inspectorUpdate();
|
||||
} else
|
||||
printIf(global.RENDER_LOG, "Rendered " + rendering.name + " (" + rendering.display_name + ") [" + string(instanceof(rendering)) + "] (Skip)");
|
||||
}
|
||||
|
||||
printIf(global.RENDER_LOG, "=== RENDER COMPLETE IN {" + string(current_time - t) + "ms} ===\n");
|
||||
} catch(e)
|
||||
noti_warning(exception_print(e));
|
||||
}
|
||||
|
||||
function __renderListReset(list) {
|
||||
for( var i = 0; i < ds_list_size(list); i++ ) {
|
||||
list[| i].setRenderStatus(false);
|
||||
if(struct_has(list[| i], "nodes"))
|
||||
__renderListReset(list[| i].nodes);
|
||||
}
|
||||
}
|
||||
|
||||
function RenderListAction(list, context = PANEL_GRAPH.getCurrentContext()) {
|
||||
try {
|
||||
var rendering = noone;
|
||||
var error = 0;
|
||||
var t = current_time;
|
||||
printIf(global.RENDER_LOG, "=== RENDER ACTION START [frame " + string(ANIMATOR.current_frame) + "] ===");
|
||||
|
||||
__renderListReset(list);
|
||||
|
||||
// get leaf node
|
||||
ds_queue_clear(RENDER_QUEUE);
|
||||
for( var i = 0; i < ds_list_size(list); i++ ) {
|
||||
var _node = list[| i];
|
||||
|
||||
if(is_undefined(_node)) continue;
|
||||
if(!is_struct(_node)) continue;
|
||||
|
||||
if(!_node.active) continue;
|
||||
if(!_node.renderActive) continue;
|
||||
if(_node.rendered) continue;
|
||||
if(__nodeInLoop(_node)) continue;
|
||||
|
||||
var _startNode = _node.isRenderable();
|
||||
if(_startNode) {
|
||||
ds_queue_enqueue(RENDER_QUEUE, _node);
|
||||
printIf(global.RENDER_LOG, " > Push " + _node.name + " (" + _node.display_name + ") node to stack");
|
||||
}
|
||||
}
|
||||
|
||||
// render forward
|
||||
while(!ds_queue_empty(RENDER_QUEUE)) {
|
||||
rendering = ds_queue_dequeue(RENDER_QUEUE);
|
||||
if(rendering.group == context) break;
|
||||
|
||||
var txt = rendering.rendered? " [Skip]" : " [Update]";
|
||||
if(!rendering.rendered) {
|
||||
rendering.doUpdate();
|
||||
if(rendering.hasInspectorUpdate())
|
||||
rendering.inspectorUpdate();
|
||||
|
||||
rendering.setRenderStatus(true);
|
||||
rendering.getNextNodes();
|
||||
}
|
||||
printIf(global.RENDER_LOG, "Rendered " + rendering.name + " [" + string(instanceof(rendering)) + "]" + txt);
|
||||
printIf(global.RENDER_LOG, "Rendered " + rendering.name + " (" + rendering.display_name + ") [" + string(instanceof(rendering)) + "]" + txt);
|
||||
}
|
||||
|
||||
printIf(global.RENDER_LOG, "=== RENDER COMPLETE IN {" + string(current_time - t) + "ms} ===\n");
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
function string_hexadecimal(str){
|
||||
static HEX = "0123456789abcdef";
|
||||
static HEX = "0123456789ABCDEF";
|
||||
|
||||
var i = string_length(str);
|
||||
var d = 1;
|
||||
|
@ -7,7 +7,7 @@ function string_hexadecimal(str){
|
|||
|
||||
while(i > 0) {
|
||||
var ch = string_char_at(str, i);
|
||||
var val = string_pos(ch, HEX) - 1;
|
||||
var val = string_pos(string_upper(ch), HEX) - 1;
|
||||
v += val * d;
|
||||
|
||||
d *= 16;
|
||||
|
@ -32,10 +32,6 @@ function number_to_hex(val) {
|
|||
return ss;
|
||||
}
|
||||
|
||||
function color_get_alpha(color) {
|
||||
return (color & (0xFF << 24)) >> 24;
|
||||
}
|
||||
|
||||
function color_get_hex(color, alpha = false) {
|
||||
var r = color_get_red(color);
|
||||
var g = color_get_green(color);
|
||||
|
|
|
@ -174,5 +174,51 @@ function surface_array_clone(arr) {
|
|||
for( var i = 0; i < array_length(arr); i++ )
|
||||
_arr[i] = surface_array_clone(arr[i]);
|
||||
|
||||
return _arr;
|
||||
}
|
||||
|
||||
function surface_array_serialize(arr) {
|
||||
var _arr = __surface_array_serialize(arr);
|
||||
return json_stringify(_arr);
|
||||
}
|
||||
|
||||
function __surface_array_serialize(arr) {
|
||||
if(!is_array(arr)) {
|
||||
if(is_surface(arr)) {
|
||||
var buff = buffer_create(surface_get_width(arr) * surface_get_height(arr) * 4, buffer_fixed, 1);
|
||||
buffer_get_surface(buff, arr, 0);
|
||||
var comp = buffer_compress(buff, 0, buffer_get_size(buff));
|
||||
var enc = buffer_base64_encode(comp, 0, buffer_get_size(comp));
|
||||
buffer_delete(buff);
|
||||
return { width: surface_get_width(arr), height: surface_get_height(arr), buffer: enc };
|
||||
} else
|
||||
return arr;
|
||||
}
|
||||
|
||||
var _arr = [];
|
||||
|
||||
for( var i = 0; i < array_length(arr); i++ )
|
||||
_arr[i] = __surface_array_serialize(arr[i]);
|
||||
|
||||
return _arr;
|
||||
}
|
||||
|
||||
function surface_array_deserialize(arr, index = -1) {
|
||||
var _arr = json_parse(arr);
|
||||
return index == -1? __surface_array_deserialize(_arr, index) : __surface_array_deserialize(_arr[index]);
|
||||
}
|
||||
|
||||
function __surface_array_deserialize(arr) {
|
||||
if(!is_array(arr)) {
|
||||
var buff = buffer_base64_decode(arr.buffer);
|
||||
var buff = buffer_decompress(buff);
|
||||
return surface_create_from_buffer(arr.width, arr.height, buff);
|
||||
}
|
||||
|
||||
var _arr = [];
|
||||
|
||||
for( var i = 0; i < array_length(arr); i++ )
|
||||
_arr[i] = __surface_array_deserialize(arr[i]);
|
||||
|
||||
return _arr;
|
||||
}
|
|
@ -14,6 +14,6 @@ vec3 hsv2rgb(vec3 c) {
|
|||
void main() {
|
||||
vec3 _rgb = hsv2rgb(vec3(hue, v_vTexcoord.x, 1.0 - v_vTexcoord.y));
|
||||
|
||||
vec4 color = vec4(_rgb.r, _rgb.g, _rgb.b, 1.0);
|
||||
vec4 color = vec4(_rgb.r, _rgb.g, _rgb.b, v_vColour.a);
|
||||
gl_FragColor = color;
|
||||
}
|
|
@ -14,6 +14,6 @@ vec3 hsv2rgb(vec3 c) {
|
|||
void main() {
|
||||
vec3 _rgb = hsv2rgb(vec3(v_vTexcoord.x, 1.0 - v_vTexcoord.y, value));
|
||||
|
||||
vec4 color = vec4(_rgb.r, _rgb.g, _rgb.b, 1.0);
|
||||
vec4 color = vec4(_rgb.r, _rgb.g, _rgb.b, v_vColour.a);
|
||||
gl_FragColor = color;
|
||||
}
|
|
@ -9,6 +9,6 @@ uniform float thres;
|
|||
|
||||
void main() {
|
||||
vec4 col = texture2D( gm_BaseTexture, v_vTexcoord );
|
||||
float n = step(distance(col, color), thres);
|
||||
float n = step(distance(col * col.a, color * color.a), thres);
|
||||
gl_FragColor = vec4(vec3(n), 1.);
|
||||
}
|
||||
|
|
BIN
sprites/s_node_cache/45e30c88-dd44-47e8-8abe-7f9fc48abf59.png
Normal file
BIN
sprites/s_node_cache/45e30c88-dd44-47e8-8abe-7f9fc48abf59.png
Normal file
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_cache/s_node_cache.yy
Normal file
74
sprites/s_node_cache/s_node_cache.yy
Normal file
|
@ -0,0 +1,74 @@
|
|||
{
|
||||
"resourceType": "GMSprite",
|
||||
"resourceVersion": "1.0",
|
||||
"name": "s_node_cache",
|
||||
"bbox_bottom": 58,
|
||||
"bbox_left": 5,
|
||||
"bbox_right": 58,
|
||||
"bbox_top": 4,
|
||||
"bboxMode": 0,
|
||||
"collisionKind": 1,
|
||||
"collisionTolerance": 0,
|
||||
"DynamicTexturePage": false,
|
||||
"edgeFiltering": false,
|
||||
"For3D": false,
|
||||
"frames": [
|
||||
{"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"45e30c88-dd44-47e8-8abe-7f9fc48abf59",},
|
||||
],
|
||||
"gridX": 0,
|
||||
"gridY": 0,
|
||||
"height": 64,
|
||||
"HTile": false,
|
||||
"layers": [
|
||||
{"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"d49d48d8-dc4a-4080-b68b-3ee6a54e0170","blendMode":0,"displayName":"default","isLocked":false,"opacity":100.0,"visible":true,},
|
||||
],
|
||||
"nineSlice": null,
|
||||
"origin": 4,
|
||||
"parent": {
|
||||
"name": "node",
|
||||
"path": "folders/nodes/icons/node.yy",
|
||||
},
|
||||
"preMultiplyAlpha": false,
|
||||
"sequence": {
|
||||
"resourceType": "GMSequence",
|
||||
"resourceVersion": "1.4",
|
||||
"name": "s_node_cache",
|
||||
"autoRecord": true,
|
||||
"backdropHeight": 768,
|
||||
"backdropImageOpacity": 0.5,
|
||||
"backdropImagePath": "",
|
||||
"backdropWidth": 1366,
|
||||
"backdropXOffset": 0.0,
|
||||
"backdropYOffset": 0.0,
|
||||
"events": {"resourceType":"KeyframeStore<MessageEventKeyframe>","resourceVersion":"1.0","Keyframes":[],},
|
||||
"eventStubScript": null,
|
||||
"eventToFunction": {},
|
||||
"length": 1.0,
|
||||
"lockOrigin": false,
|
||||
"moments": {"resourceType":"KeyframeStore<MomentsEventKeyframe>","resourceVersion":"1.0","Keyframes":[],},
|
||||
"playback": 1,
|
||||
"playbackSpeed": 30.0,
|
||||
"playbackSpeedType": 0,
|
||||
"showBackdrop": true,
|
||||
"showBackdropImage": false,
|
||||
"timeUnits": 1,
|
||||
"tracks": [
|
||||
{"resourceType":"GMSpriteFramesTrack","resourceVersion":"1.0","name":"frames","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"resourceType":"KeyframeStore<SpriteFrameKeyframe>","resourceVersion":"1.0","Keyframes":[
|
||||
{"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"1.0","Channels":{"0":{"resourceType":"SpriteFrameKeyframe","resourceVersion":"1.0","Id":{"name":"45e30c88-dd44-47e8-8abe-7f9fc48abf59","path":"sprites/s_node_cache/s_node_cache.yy",},},},"Disabled":false,"id":"2e954071-098b-48ff-a036-fd5969396731","IsCreationKey":false,"Key":0.0,"Length":1.0,"Stretch":false,},
|
||||
],},"modifiers":[],"spriteId":null,"trackColour":0,"tracks":[],"traits":0,},
|
||||
],
|
||||
"visibleRange": null,
|
||||
"volume": 1.0,
|
||||
"xorigin": 32,
|
||||
"yorigin": 32,
|
||||
},
|
||||
"swatchColours": null,
|
||||
"swfPrecision": 2.525,
|
||||
"textureGroupId": {
|
||||
"name": "Default",
|
||||
"path": "texturegroups/Default",
|
||||
},
|
||||
"type": 0,
|
||||
"VTile": false,
|
||||
"width": 64,
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue