This commit is contained in:
Tanasart 2023-12-15 18:56:36 +07:00
parent e58cf96d2f
commit 11e01a64e8
57 changed files with 2038 additions and 230 deletions

View file

@ -298,7 +298,6 @@
{"name":"sh_mk_tile18_edge_r","order":2,"path":"shaders/sh_mk_tile18_edge_r/sh_mk_tile18_edge_r.yy",},
{"name":"node_active_canvas","order":22,"path":"scripts/node_active_canvas/node_active_canvas.yy",},
{"name":"s_node_fluidSim_turbulence","order":10,"path":"sprites/s_node_fluidSim_turbulence/s_node_fluidSim_turbulence.yy",},
{"name":"windowManager","order":1,"path":"scripts/windowManager/windowManager.yy",},
{"name":"node_pb_fx_hash","order":7,"path":"scripts/node_pb_fx_hash/node_pb_fx_hash.yy",},
{"name":"sh_pb_draw_mask","order":8,"path":"shaders/sh_pb_draw_mask/sh_pb_draw_mask.yy",},
{"name":"node_blur_radial","order":7,"path":"scripts/node_blur_radial/node_blur_radial.yy",},
@ -466,6 +465,7 @@
{"name":"sh_cell_noise_round","order":4,"path":"shaders/sh_cell_noise_round/sh_cell_noise_round.yy",},
{"name":"s_node_cross_product_2d","order":12,"path":"sprites/s_node_cross_product_2d/s_node_cross_product_2d.yy",},
{"name":"d3d_uvsphere","order":3,"path":"scripts/d3d_uvsphere/d3d_uvsphere.yy",},
{"name":"gameframe_native","order":2,"path":"extensions/gameframe_native/gameframe_native.yy",},
{"name":"s_node_path_plot","order":12,"path":"sprites/s_node_path_plot/s_node_path_plot.yy",},
{"name":"__initAddon","order":2,"path":"scripts/__initAddon/__initAddon.yy",},
{"name":"node_pb_draw_trapezoid","order":8,"path":"scripts/node_pb_draw_trapezoid/node_pb_draw_trapezoid.yy",},
@ -710,6 +710,7 @@
{"name":"node_noise_shard","order":12,"path":"scripts/node_noise_shard/node_noise_shard.yy",},
{"name":"s_node_color_remove","order":7,"path":"sprites/s_node_color_remove/s_node_color_remove.yy",},
{"name":"sh_average","order":7,"path":"shaders/sh_average/sh_average.yy",},
{"name":"sh_draw_surface","order":52,"path":"shaders/sh_draw_surface/sh_draw_surface.yy",},
{"name":"sh_warp_4points_pers","order":10,"path":"shaders/sh_warp_4points_pers/sh_warp_4points_pers.yy",},
{"name":"node_mirror","order":3,"path":"scripts/node_mirror/node_mirror.yy",},
{"name":"node_corner","order":6,"path":"scripts/node_corner/node_corner.yy",},
@ -759,6 +760,7 @@
{"name":"node_tile","order":4,"path":"scripts/node_tile/node_tile.yy",},
{"name":"sh_rsh_rotate","order":1,"path":"shaders/sh_rsh_rotate/sh_rsh_rotate.yy",},
{"name":"FirebaseFirestoreMainFunctions","order":1,"path":"scripts/FirebaseFirestoreMainFunctions/FirebaseFirestoreMainFunctions.yy",},
{"name":"node_mk_sparkle","order":7,"path":"scripts/node_mk_sparkle/node_mk_sparkle.yy",},
{"name":"node_VFX_effect_destroy","order":3,"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":3,"path":"shaders/sh_bw/sh_bw.yy",},
@ -952,6 +954,7 @@
{"name":"s_node_3d_meterial","order":12,"path":"sprites/s_node_3d_meterial/s_node_3d_meterial.yy",},
{"name":"__surface","order":8,"path":"scripts/__surface/__surface.yy",},
{"name":"clipboard","order":7,"path":"extensions/clipboard/clipboard.yy",},
{"name":"gameframe","order":3,"path":"scripts/gameframe/gameframe.yy",},
{"name":"__node_3d_light","order":1,"path":"scripts/__node_3d_light/__node_3d_light.yy",},
{"name":"d3d_icosphere","order":4,"path":"scripts/d3d_icosphere/d3d_icosphere.yy",},
{"name":"s_node_edge_detect","order":22,"path":"sprites/s_node_edge_detect/s_node_edge_detect.yy",},
@ -1050,7 +1053,7 @@
{"name":"node_3d_uv_remap","order":5,"path":"scripts/node_3d_uv_remap/node_3d_uv_remap.yy",},
{"name":"fd_rectangle_get_initial_value_pressure","order":7,"path":"scripts/fd_rectangle_get_initial_value_pressure/fd_rectangle_get_initial_value_pressure.yy",},
{"name":"node_timeline_preview","order":2,"path":"scripts/node_timeline_preview/node_timeline_preview.yy",},
{"name":"display_measure","order":2,"path":"extensions/display_measure/display_measure.yy",},
{"name":"display_measure","order":1,"path":"extensions/display_measure/display_measure.yy",},
{"name":"__polygon","order":2,"path":"scripts/__polygon/__polygon.yy",},
{"name":"o_dialog_fontscrollbox","order":5,"path":"objects/o_dialog_fontscrollbox/o_dialog_fontscrollbox.yy",},
{"name":"sh_d3d_normal_blur","order":25,"path":"shaders/sh_d3d_normal_blur/sh_d3d_normal_blur.yy",},
@ -1707,6 +1710,7 @@
{"name":"panel_array_sequence","order":3,"path":"scripts/panel_array_sequence/panel_array_sequence.yy",},
{"name":"sh_displace","order":5,"path":"shaders/sh_displace/sh_displace.yy",},
{"name":"fd_rectangle_get_material_height","order":10,"path":"scripts/fd_rectangle_get_material_height/fd_rectangle_get_material_height.yy",},
{"name":"s_node_mk_sparkle","order":7,"path":"sprites/s_node_mk_sparkle/s_node_mk_sparkle.yy",},
{"name":"rangeBox","order":9,"path":"scripts/rangeBox/rangeBox.yy",},
{"name":"s_node_array_copy","order":14,"path":"sprites/s_node_array_copy/s_node_array_copy.yy",},
{"name":"node_VFX_effect_accelerate","order":1,"path":"scripts/node_VFX_effect_accelerate/node_VFX_effect_accelerate.yy",},

View file

@ -679,6 +679,7 @@
{"id":{"name":"sh_cell_noise_round","path":"shaders/sh_cell_noise_round/sh_cell_noise_round.yy",},},
{"id":{"name":"s_node_cross_product_2d","path":"sprites/s_node_cross_product_2d/s_node_cross_product_2d.yy",},},
{"id":{"name":"d3d_uvsphere","path":"scripts/d3d_uvsphere/d3d_uvsphere.yy",},},
{"id":{"name":"gameframe_native","path":"extensions/gameframe_native/gameframe_native.yy",},},
{"id":{"name":"s_node_path_plot","path":"sprites/s_node_path_plot/s_node_path_plot.yy",},},
{"id":{"name":"__initAddon","path":"scripts/__initAddon/__initAddon.yy",},},
{"id":{"name":"node_pb_draw_trapezoid","path":"scripts/node_pb_draw_trapezoid/node_pb_draw_trapezoid.yy",},},
@ -961,6 +962,7 @@
{"id":{"name":"node_3d_particle","path":"scripts/node_3d_particle/node_3d_particle.yy",},},
{"id":{"name":"s_node_color_remove","path":"sprites/s_node_color_remove/s_node_color_remove.yy",},},
{"id":{"name":"sh_average","path":"shaders/sh_average/sh_average.yy",},},
{"id":{"name":"sh_draw_surface","path":"shaders/sh_draw_surface/sh_draw_surface.yy",},},
{"id":{"name":"sh_warp_4points_pers","path":"shaders/sh_warp_4points_pers/sh_warp_4points_pers.yy",},},
{"id":{"name":"node_mirror","path":"scripts/node_mirror/node_mirror.yy",},},
{"id":{"name":"node_corner","path":"scripts/node_corner/node_corner.yy",},},
@ -1018,6 +1020,7 @@
{"id":{"name":"node_tile","path":"scripts/node_tile/node_tile.yy",},},
{"id":{"name":"sh_rsh_rotate","path":"shaders/sh_rsh_rotate/sh_rsh_rotate.yy",},},
{"id":{"name":"FirebaseFirestoreMainFunctions","path":"scripts/FirebaseFirestoreMainFunctions/FirebaseFirestoreMainFunctions.yy",},},
{"id":{"name":"node_mk_sparkle","path":"scripts/node_mk_sparkle/node_mk_sparkle.yy",},},
{"id":{"name":"node_VFX_effect_destroy","path":"scripts/node_VFX_effect_destroy/node_VFX_effect_destroy.yy",},},
{"id":{"name":"node_cache","path":"scripts/node_cache/node_cache.yy",},},
{"id":{"name":"sh_bw","path":"shaders/sh_bw/sh_bw.yy",},},
@ -1239,6 +1242,7 @@
{"id":{"name":"s_node_3d_meterial","path":"sprites/s_node_3d_meterial/s_node_3d_meterial.yy",},},
{"id":{"name":"__surface","path":"scripts/__surface/__surface.yy",},},
{"id":{"name":"clipboard","path":"extensions/clipboard/clipboard.yy",},},
{"id":{"name":"gameframe","path":"scripts/gameframe/gameframe.yy",},},
{"id":{"name":"__node_3d_light","path":"scripts/__node_3d_light/__node_3d_light.yy",},},
{"id":{"name":"rotator","path":"scripts/rotator/rotator.yy",},},
{"id":{"name":"d3d_icosphere","path":"scripts/d3d_icosphere/d3d_icosphere.yy",},},
@ -1356,7 +1360,6 @@
{"id":{"name":"node_fluid_render_output","path":"scripts/node_fluid_render_output/node_fluid_render_output.yy",},},
{"id":{"name":"s_node_vfx_output","path":"sprites/s_node_vfx_output/s_node_vfx_output.yy",},},
{"id":{"name":"sh_greyscale","path":"shaders/sh_greyscale/sh_greyscale.yy",},},
{"id":{"name":"gameframe_native","path":"extensions/gameframe_native/gameframe_native.yy",},},
{"id":{"name":"s_node_pb_box_mirror","path":"sprites/s_node_pb_box_mirror/s_node_pb_box_mirror.yy",},},
{"id":{"name":"__node_shader_generator","path":"scripts/__node_shader_generator/__node_shader_generator.yy",},},
{"id":{"name":"node_global","path":"scripts/node_global/node_global.yy",},},
@ -2104,6 +2107,7 @@
{"id":{"name":"node_group","path":"scripts/node_group/node_group.yy",},},
{"id":{"name":"fd_rectangle_get_material_height","path":"scripts/fd_rectangle_get_material_height/fd_rectangle_get_material_height.yy",},},
{"id":{"name":"node_PCX_fn_surface_height","path":"scripts/node_PCX_fn_surface_height/node_PCX_fn_surface_height.yy",},},
{"id":{"name":"s_node_mk_sparkle","path":"sprites/s_node_mk_sparkle/s_node_mk_sparkle.yy",},},
{"id":{"name":"rangeBox","path":"scripts/rangeBox/rangeBox.yy",},},
{"id":{"name":"s_node_array_copy","path":"sprites/s_node_array_copy/s_node_array_copy.yy",},},
{"id":{"name":"node_VFX_effect_accelerate","path":"scripts/node_VFX_effect_accelerate/node_VFX_effect_accelerate.yy",},},

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

View file

@ -355,7 +355,7 @@ event_inherited();
continue;
for( var j = 0; j < ds_list_size(cat.list); j++ ) {
if(is_string(cat.list[| j])) continue;
//if(is_string(cat.list[| j])) continue;
ds_list_add(_list, cat.list[| j]);
}
}
@ -519,7 +519,7 @@ event_inherited();
}
}
if(ADD_NODE_PAGE > -2 && PREFERENCES.dialog_add_node_grouping) {
if(PREFERENCES.dialog_add_node_grouping) {
var len = array_length(group_labels);
if(len) {
gpu_set_blendmode(bm_subtract);
@ -620,7 +620,7 @@ event_inherited();
hh += list_height;
}
if(ADD_NODE_PAGE > -2 && PREFERENCES.dialog_add_node_grouping) {
if(PREFERENCES.dialog_add_node_grouping) {
gpu_set_blendmode(bm_subtract);
draw_set_color(c_white);
draw_rectangle(0, 0, content_pane.surface_w, ui(16 + 24 / 2), false);

View file

@ -8,11 +8,9 @@ if !ready exit;
#region search
WIDGET_CURRENT = tb_search;
tb_search.setFocusHover(sFOCUS, sHOVER);
if(search_string == "") {
tb_search.setFocusHover(false, false);
tb_search.sprite_index = 1;
catagory_pane.setFocusHover(sFOCUS, sHOVER);
catagory_pane.draw(dialog_x + ui(14), dialog_y + ui(52));
@ -23,7 +21,6 @@ if !ready exit;
node_selecting = 0;
} else {
tb_search.setFocusHover(true, true);
draw_sprite_stretched(THEME.ui_panel_bg, 1, dialog_x + ui(14), dialog_y + ui(52), dialog_w - ui(28), dialog_h - ui(66));
search_pane.setFocusHover(sFOCUS, sHOVER);
search_pane.draw(dialog_x + ui(16), dialog_y + ui(52));

View file

@ -14,8 +14,8 @@
window_set_min_width(960);
window_set_min_height(600);
if(OS == os_macosx)
mac_window_init();
//if(OS == os_windows) gameframe_init_native();
if(OS == os_macosx) mac_window_init();
depth = 0;
win_wp = WIN_W;

View file

@ -45,6 +45,8 @@
directory_verify(DIRECTORY);
APP_LOCATION = program_directory;
if(OS == os_macosx)
APP_LOCATION = string_replace(APP_LOCATION, "/Contents/MacOS/", "/Contents/Resources/");
if(string_pos("GameMakerStudio2\\Cache\\runtimes", APP_LOCATION))
APP_LOCATION = working_directory;
print($"===================== WORKING DIRECTORIES =====================\n\t{working_directory}\n\t{DIRECTORY}");

View file

@ -7,11 +7,13 @@ HOVERING_ELEMENT = _HOVERING_ELEMENT;
_HOVERING_ELEMENT = noone;
#region minimize
if(OS == os_windows && winMan_isMinimized()) {
if(!minimized)
game_set_speed(1, gamespeed_fps);
minimized = true;
exit;
if(OS == os_windows) {
if(winMan_isMinimized()) {
if(!minimized)
game_set_speed(1, gamespeed_fps);
minimized = true;
exit;
}
}
if(minimized) {

View file

@ -13,5 +13,5 @@
#macro BLEND_MULTIPLY gpu_set_blendmode_ext(bm_dest_colour, bm_zero)
#macro BLEND_SUBTRACT gpu_set_blendmode(bm_subtract)
#macro DRAW_CLEAR draw_clear_alpha(0, 0)
#macro DRAW_CLEAR draw_clear_alpha(0, 0);
#endregion

View file

@ -68,7 +68,7 @@ function __3dSurfaceExtrude(surface = noone, height = noone, smooth = false) : _
var hgh = surface_get_height_safe(_height);
var hgtW = hgw / ww;
var hgtH = hgh / hh;
var height_buffer = buffer_create(hgw * hgh * 4, buffer_fixed, 2);
buffer_get_surface(height_buffer, _height, 0);
buffer_seek(height_buffer, buffer_seek_start, 0);

View file

@ -11,54 +11,54 @@
}
#endregion
function _log_template() {
function _log_template() { #region
INLINE
return $"{current_year}/{current_month}/{current_day} {string_lead_zero(current_hour, 2)}:{string_lead_zero(current_minute, 2)}:{string_lead_zero(current_second, 2)} > ";
}
} #endregion
function __log(title, str, fname = "log/log.txt") {
function __log(title, str, fname = "log/log.txt") { #region
var path = DIRECTORY + fname;
var f = file_text_open_append(path);
var t = _log_template();
file_text_write_string(f, $"{title}{t}{str}\n");
file_text_close(f);
}
} #endregion
function log_message(title, str, icon = noone, flash = false, write = true) {
function log_message(title, str, icon = noone, flash = false, write = true) { #region
if(TEST_ERROR) return;
if(write) __log("[MESSAGE] ", string(title) + ": " + string(str));
return noti_status(string(title) + ": " + string(str), icon, flash);
}
} #endregion
function log_warning(title, str, ref = noone) {
function log_warning(title, str, ref = noone) { #region
if(TEST_ERROR) return;
__log("[WARNING] ", string(title) + ": " + string(str));
return noti_warning(string(title) + ": " + string(str),, ref);
}
} #endregion
function log_crash(str) {
function log_crash(str) { #region
if(TEST_ERROR) return;
__log("[ERROR] ", string(str));
return noti_error(string(str));
}
} #endregion
function log_newline() {
function log_newline() { #region
var path = DIRECTORY + "log/log.txt";
var f = file_text_open_write(path);
file_text_writeln(f);
file_text_close(f);
}
} #endregion
function log_clear() {
function log_clear() { #region
var path = DIRECTORY + "log/log.txt";
if(file_exists_empty(path))
file_delete(path);
}
} #endregion
function exception_print(e) {
function exception_print(e) { #region
if(!is_struct(e) || !struct_has(e, "longMessage")) return string(e);
var str = "\n\n========== Crash log ==========\n\n" + e.longMessage;
@ -70,10 +70,10 @@ function exception_print(e) {
str += "\n\n========= Crash log end =========\n";
return str;
}
} #endregion
function setException() {
if(OS == os_macosx) return;
function setException() { #region
if(OS == os_macosx) return noone;
exception_unhandled_handler(function(ex) {
var path = string(DIRECTORY) + "prev_crash.pxc";
@ -88,23 +88,25 @@ function setException() {
}
tt += "\n---------------------------- :( ----------------------------\n";
var path = program_directory + "report/crash_log.txt";
var path = $"{env_user()}crash_log.txt";
file_text_write_all(path, tt);
clipboard_set_text(tt);
show_debug_message(tt);
var rep = $"{program_directory}report\\PXC crash reporter.exe";
//show_message($"Save crash report at {path} : Opening crash reporter at {rep} [{file_exists(rep)}]");
shell_execute_async(rep, DIRECTORY);
if(OS == os_macosx) rep = $"{program_directory}PXC_crash_reporter.app";
var pid = shell_execute_async(rep, DIRECTORY);
show_message($"{rep} [{file_exists(rep)}]: {pid}");
return 0;
});
}
//setException();
} #endregion
function resetException() { exception_unhandled_handler(undefined); }
function printCallStack(maxDepth = 32) {
function printCallStack(maxDepth = 32) { #region
var stack = debug_get_callstack(maxDepth);
print($"Call Stack:");
@ -133,4 +135,4 @@ function printCallStack(maxDepth = 32) {
}
}
print("")
}
} #endregion

View file

@ -17,8 +17,8 @@ function filepath_resolve(path) {
function get_open_filenames_compat(ext, sel) {
INLINE
return get_open_filenames(ext, sel);
//return get_open_filenames(ext, sel);
//if(OS == os_windows) return get_open_filenames(ext, sel);
//return get_open_filename(ext, sel);
if(OS == os_windows) return get_open_filenames(ext, sel);
return get_open_filename(ext, sel);
}

View file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,11 @@
{
"resourceType": "GMScript",
"resourceVersion": "1.0",
"name": "gameframe",
"isCompatibility": false,
"isDnD": false,
"parent": {
"name": "WinMan",
"path": "folders/_extensions/WinMan.yy",
},
}

View file

@ -25,10 +25,10 @@
globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER, LATEST_VERSION;
LATEST_VERSION = 11500;
VERSION = 11603;
VERSION = 11604;
SAVE_VERSION = 11600.1;
VERSION_STRING = "1.16.0.3";
BUILD_NUMBER = 11603;
VERSION_STRING = "1.16.0.4";
BUILD_NUMBER = 11604;
globalvar APPEND_MAP;
APPEND_MAP = ds_map_create();

View file

@ -18,6 +18,8 @@ function Node_3D_Mesh_Extrude(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y, _gr
["Extrude", false], in_mesh + 0, in_mesh + 1, in_mesh + 3,
]
temp_surface = [ noone, noone ];
static processData = function(_output, _data, _output_index, _array_index = 0) { #region
var _mat = _data[in_mesh + 0];
if(!is_instanceof(_mat, __d3dMaterial)) return noone;
@ -27,8 +29,11 @@ function Node_3D_Mesh_Extrude(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y, _gr
var _updt = _data[in_mesh + 3];
var _surf = _mat.surface;
temp_surface[0] = surface_cvt_8unorm(temp_surface[0], _surf);
temp_surface[1] = surface_cvt_8unorm(temp_surface[1], _hght);
var object = getObject(_array_index);
object.checkParameter({ surface: _surf, height: _hght, smooth: _smt }, _updt);
object.checkParameter({ surface: temp_surface[0], height: temp_surface[1], smooth: _smt }, _updt);
var _matN = _mat.clone();
var _nSurf = surface_create(surface_get_width(_surf), surface_get_height(_surf));
@ -38,7 +43,7 @@ function Node_3D_Mesh_Extrude(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y, _gr
draw_surface_safe(_surf);
surface_reset_shader();
_matN.surface = _nSurf;
_matN.surface = _nSurf;
object.materials = [ _matN ];
setTransform(object, _data);

View file

@ -858,7 +858,7 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
applyScal: _psca,
});
surface_set_shader(temp_surface[_bg], sh_sample, true, BLEND.over);
surface_set_shader(temp_surface[_bg], sh_sample, true, BLEND.alphamulp);
blend_temp_surface = temp_surface[2];
draw_surface_blend_ext(temp_surface[!_bg], _s, _pos[0], _pos[1], _sca[0], _sca[1], _rot);
surface_reset_shader();

View file

@ -1,7 +1,7 @@
function Node_create_Blend(_x, _y, _group = noone, _param = {}) {
function Node_create_Blend(_x, _y, _group = noone, _param = {}) { #region
var node = new Node_Blend(_x, _y, _group);
return node;
}
} #endregion
function Node_Blend(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
name = "Blend";
@ -44,13 +44,16 @@ function Node_Blend(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
inputs[| 13] = nodeValue("Mask feather", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1)
.setDisplay(VALUE_DISPLAY.slider, { range: [1, 16, 1] });
inputs[| 14] = nodeValue("Position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0.5, 0.5 ])
.setDisplay(VALUE_DISPLAY.vector);
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
input_display_list = [ 8,
["Surfaces", true], 0, 1, 4, 12, 13, 6, 7,
["Blend", false], 2, 3, 9,
["Transform", false], 5, 10, 11,
["Transform", false], 5, 14,
]
attribute_surface_depth();
@ -58,6 +61,66 @@ function Node_Blend(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
temp_surface = [ surface_create(1, 1), surface_create(1, 1) ];
blend_temp_surface = temp_surface[1];
dragging = false;
drag_sx = 0;
drag_sy = 0;
drag_mx = 0;
drag_my = 0;
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { #region
var _surf = outputs[| 0].getValue();
if(is_array(_surf)) _surf = array_safe_get(_surf, preview_index);
if(is_struct(_surf)) return;
if(!surface_exists(_surf)) return;
var _fore = getSingleValue( 1);
var _fill = getSingleValue( 5);
var _posi = getSingleValue(14);
if(_fill) return;
var sw = surface_get_width_safe( _surf);
var sh = surface_get_height_safe(_surf);
var fw = surface_get_width_safe( _fore);
var fh = surface_get_height_safe(_fore);
var _rx = _posi[0] * sw - fw / 2;
var _ry = _posi[1] * sh - fh / 2;
_rx = _x + _rx * _s;
_ry = _y + _ry * _s;
var _rw = fw * _s;
var _rh = fh * _s;
if(dragging) {
var px = drag_sx + (_mx - drag_mx) / _s;
var py = drag_sy + (_my - drag_my) / _s;
px /= sw;
py /= sh;
if(inputs[| 14].setValue([ px, py ]))
UNDO_HOLDING = true;
if(mouse_release(mb_left)) {
UNDO_HOLDING = false;
dragging = false;
}
}
draw_set_color(COLORS._main_accent);
if(dragging || (active && point_in_rectangle(_mx, _my, _rx, _ry, _rx + _rw, _ry + _rh))) {
draw_rectangle_width(_rx, _ry, _rx + _rw, _ry + _rh, 2);
if(mouse_press(mb_left)) {
dragging = true;
drag_sx = _posi[0] * sw;
drag_sy = _posi[1] * sh;
drag_mx = _mx;
drag_my = _my;
}
} else
draw_rectangle(_rx, _ry, _rx + _rw, _ry + _rh, true);
} #endregion
static step = function() { #region
var _back = getSingleValue(0);
var _fore = getSingleValue(1);
@ -70,8 +133,7 @@ function Node_Blend(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
inputs[| 6].editWidget.data_list = _atlas? [ "Background", "Forground" ] : [ "Background", "Forground", "Mask", "Maximum", "Constant" ];
inputs[| 7].setVisible(_outp == 4);
inputs[| 10].setVisible(_fill == 0 && !_atlas);
inputs[| 11].setVisible(_fill == 0 && !_atlas);
inputs[| 14].setVisible(_fill == 0 && !_atlas);
var _msk = is_surface(getSingleValue(4));
inputs[| 12].setVisible(_msk);
@ -92,6 +154,7 @@ function Node_Blend(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
var _halign = _data[10];
var _valign = _data[11];
var _posit = _data[14];
var _mskInv = _data[12];
var _mskFea = _data[13];
@ -156,20 +219,11 @@ function Node_Blend(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
var fw = surface_get_width_safe(_fore);
var fh = surface_get_height_safe(_fore);
switch(_halign) {
case 0 : sx = 0; break;
case 1 : sx = ww / 2 - fw / 2; break;
case 2 : sx = ww - fw; break;
}
switch(_valign) {
case 0 : sy = 0; break;
case 1 : sy = hh / 2 - fh / 2; break;
case 2 : sy = hh - fh; break;
}
var px = _posit[0] * ww;
var py = _posit[1] * hh;
surface_set_shader(_foreDraw, noone,, BLEND.over);
draw_surface_safe(_fore, sx, sy);
draw_surface_safe(_fore, px - fw / 2, py - fh / 2);
surface_reset_shader();
}
}

View file

@ -96,13 +96,13 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
.rejectArray();
format_image = [ ".png", ".jpg", ".webp" ];
format_animation = [ ".gif", ".webp", ".mp4" ];
format_animation = [ ".gif", ".apng", ".webp", ".mp4" ];
inputs[| 9] = nodeValue("Format", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
.setDisplay(VALUE_DISPLAY.enum_scroll, { data: format_image, update_hover: false })
.rejectArray();
inputs[| 10] = nodeValue("Quality", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 80)
inputs[| 10] = nodeValue("Quality", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 23)
.setDisplay(VALUE_DISPLAY.slider, { range: [ 0, 100, 1 ] })
.rejectArray();
@ -202,9 +202,8 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
input_display_list = [
["Export", false], 0, 1, 2, export_template,
["Format ", false], 3, 9,
["Format ", false], 3, 9, 6, 7, 10, 13,
["Animation", false], 12, 8, 5, 11, 14,
["Quality", false], 6, 7, 10, 13,
];
render_process_id = 0;
@ -218,10 +217,27 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
gifski = filepath_resolve(PREFERENCES.gifski_path) + "win/gifski.exe";
ffmpeg = filepath_resolve(PREFERENCES.ffmpeg_path) + "bin/ffmpeg.exe";
if(!file_exists_empty(converter) || !file_exists_empty(magick)) noti_warning($"No ImageMagick detected at {magick}, please make sure the installation is complete and ImageMagick path is set properly in preference.");
if(!file_exists_empty(webp)) noti_warning($"No webp detected at {webp}, please make sure the installation is complete and webp path is set properly in preference.");
if(!file_exists_empty(gifski)) noti_warning($"No gifski detected at {gifski}, please make sure the installation is complete and gifski path is set properly in preference.");
if(!file_exists_empty(ffmpeg)) noti_warning($"No ffmpeg detected at {ffmpeg}, please make sure the installation is complete and ffmpeg path is set properly in preference.");
if(OS == os_windows) {
if(!file_exists_empty(converter) || !file_exists_empty(magick)) noti_warning($"No ImageMagick detected at {magick}, please make sure the installation is complete and ImageMagick path is set properly in preference.");
if(!file_exists_empty(webp)) noti_warning($"No webp detected at {webp}, please make sure the installation is complete and webp path is set properly in preference.");
if(!file_exists_empty(gifski)) noti_warning($"No gifski detected at {gifski}, please make sure the installation is complete and gifski path is set properly in preference.");
if(!file_exists_empty(ffmpeg)) noti_warning($"No FFmpeg detected at {ffmpeg}, please make sure the installation is complete and FFmpeg path is set properly in preference.");
} else if(OS == os_macosx) {
var check_convert = ExecutedProcessReadFromStandardOutput(shell_execute("convert", ""));
if(string_pos(check_convert, "not found")) noti_warning($"No ImageMagick installed, please install imagemagick with homebrew or use the provided 'mac-libraries-installer.command'.");
var check_webp = ExecutedProcessReadFromStandardOutput(shell_execute("webp", ""));
if(string_pos(check_webp, "not found")) noti_warning($"No webp installed, please install webp with homwbrew or use the provided 'mac-libraries-installer.command'.");
var check_ffmpeg = ExecutedProcessReadFromStandardOutput(shell_execute("ffmpeg", ""));
if(string_pos(check_ffmpeg, "not found")) noti_warning($"No FFmpeg installed, please install FFmpeg with homebrew or use the provided 'mac-libraries-installer.command'.");
var _opt = "/opt/homebrew/bin/";
converter = _opt + "convert";
magick = _opt + "magick";
webp = _opt + "webp";
ffmpeg = _opt + "ffmpeg";
}
static onValueUpdate = function(_index) { #region
var form = getInputData(3);
@ -329,20 +345,11 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
var loop_str = loop? 0 : 1;
var use_gifski = false;
if(use_gifski) {
var shell_cmd = $"-o {string_quote(target_path)} -r {rate} --repeat {loop_str} -Q {qual} {string_quote(temp_path)}";
var shell_cmd = $"-delay {framerate} -alpha set -dispose previous -loop {loop_str}";
if(opti) shell_cmd += $" -fuzz {fuzz * 100}% -layers OptimizeFrame -layers OptimizeTransparency";
shell_cmd += $" {string_quote(temp_path)} {string_quote(target_path)}";
//print($"{gifski} {shell_cmd}");
render_process_id = shell_execute_async(gifski, shell_cmd, self);
} else {
var shell_cmd = $"-delay {framerate} -alpha set -dispose previous -loop {loop_str}";
if(opti) shell_cmd += $" -fuzz {fuzz * 100}% -layers OptimizeFrame -layers OptimizeTransparency";
shell_cmd += $" {string_quote(temp_path)} {string_quote(target_path)}";
//print($"{converter} {shell_cmd}");
render_process_id = shell_execute_async(converter, shell_cmd, self);
}
render_process_id = shell_execute_async(converter, shell_cmd, self);
render_type = "gif";
render_target = target_path;
@ -351,6 +358,7 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
static renderMp4 = function(temp_path, target_path) { #region
var rate = getInputData( 8);
var qual = getInputData(10); qual = clamp(qual, 0, 51);
if(rate == 0) rate = 1;
if(file_exists_empty(target_path)) file_delete(target_path);
@ -358,8 +366,7 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
temp_path = string_replace_all(temp_path, "/", "\\");
target_path = string_replace_all(target_path, "/", "\\");
var shell_cmd = $"-hide_banner -loglevel quiet -framerate {rate} -i \"{temp_path}%05d.png\" -c:v libx264 -r {rate} -pix_fmt yuv420p {string_quote(target_path)}";
print($"{ffmpeg} {shell_cmd}")
var shell_cmd = $"-hide_banner -loglevel quiet -framerate {rate} -i \"{temp_path}%05d.png\" -c:v libx264 -r {rate} -pix_fmt yuv420p -crf {qual} {string_quote(target_path)}";
render_process_id = shell_execute_async(ffmpeg, shell_cmd, self);
render_type = "mp4";
@ -367,6 +374,24 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
if(render_process_id != 0) array_push(RENDERING, node_id);
} #endregion
static renderApng = function(temp_path, target_path) { #region
var rate = getInputData( 8);
if(rate == 0) rate = 1;
if(file_exists_empty(target_path)) file_delete(target_path);
temp_path = string_replace_all(temp_path, "/", "\\");
target_path = string_replace_all(target_path, "/", "\\");
var shell_cmd = $"-hide_banner -loglevel quiet -framerate {rate} -i \"{temp_path}%05d.png\" -plays 0 {string_quote(target_path)}";
render_process_id = shell_execute_async(ffmpeg, shell_cmd, self);
render_type = "apng";
render_target = target_path;
if(render_process_id != 0) array_push(RENDERING, node_id);
} #endregion
static pathString = function(path, index = 0, _array = false) { #region
var suff = getInputData( 2);
@ -608,37 +633,45 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
if(is_array(path)) target_path = pathString(array_safe_get(path, i), i);
else target_path = pathString(path, i);
switch(extd) {
case 0 :
switch(format_animation[extd]) {
case ".gif" :
target_path = string_replace(target_path, ".png", ".gif");
renderGif(temp_path, target_path);
break;
case 1 :
case ".webp" :
target_path = string_replace(target_path, ".png", ".webp");
renderWebp(temp_path, target_path);
break;
case 2 :
case ".mp4" :
target_path = string_replace(target_path, ".png", ".mp4");
renderMp4(temp_path, target_path);
break;
case ".apng" :
target_path = string_replace(target_path, ".png", ".apng");
renderApng(temp_path, target_path);
break;
}
}
} else {
target_path = pathString(path);
switch(extd) {
case 0 :
switch(format_animation[extd]) {
case ".gif" :
target_path = string_replace(target_path, ".png", ".gif");
renderGif(directory + "/*.png", target_path);
break;
case 1 :
case ".webp" :
target_path = string_replace(target_path, ".png", ".webp");
renderWebp(directory + "/", target_path);
break;
case 2 :
case ".mp4" :
target_path = string_replace(target_path, ".png", ".mp4");
renderMp4(directory + "/", target_path);
break;
case ".apng" :
target_path = string_replace(target_path, ".png", ".apng");
renderApng(directory + "/", target_path);
break;
}
}
@ -711,24 +744,56 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
var anim = getInputData(3); // single, sequence, animation
var extn = getInputData(9);
inputs[| 5].setVisible(anim == 2 && extn != 2);
inputs[| 6].setVisible(anim == 2 && extn != 2);
inputs[| 7].setVisible(anim == 2 && extn != 2);
inputs[| 8].setVisible(anim == 2);
inputs[| 11].setVisible(anim == 1);
inputs[| 12].setVisible(anim > 0);
inputs[| 12].editWidget.maxx = TOTAL_FRAMES;
inputs[| 13].setVisible(anim < 2);
inputs[| 14].setVisible(anim > 0);
if(anim == NODE_EXPORT_FORMAT.animation) {
var _fmt = array_safe_get(format_animation, extn);
inputs[| 5].setVisible(_fmt == ".gif");
inputs[| 6].setVisible(_fmt == ".gif");
inputs[| 7].setVisible(_fmt == ".gif");
inputs[| 8].setVisible(true);
inputs[| 9].display_data.data = format_animation;
inputs[| 9].editWidget.data_list = format_animation;
inputs[| 10].setVisible(extn != 2);
inputs[| 13].setVisible(false);
if(_fmt == ".mp4") {
inputs[| 10].setName("CRF value");
inputs[| 10].tooltip = "Quality of the output, with 0 being the highest (and largest file size), and 51 being the lowest.";
inputs[| 10].setVisible(true);
inputs[| 10].editWidget.minn = 0;
inputs[| 10].editWidget.maxx = 51;
} else
inputs[| 10].setVisible(false);
} else {
var _fmt = array_safe_get(format_image, extn);
inputs[| 5].setVisible(false);
inputs[| 6].setVisible(false);
inputs[| 7].setVisible(false);
inputs[| 8].setVisible(false);
inputs[| 9].display_data.data = format_image;
inputs[| 9].editWidget.data_list = format_image;
inputs[| 10].setVisible(extn != 0);
inputs[| 13].setVisible(_fmt == ".png");
if(_fmt == ".jpg" || _fmt == ".webp") {
inputs[| 10].setName("Quality");
inputs[| 10].tooltip = "Quality of the output.";
inputs[| 10].setVisible(true);
inputs[| 10].editWidget.minn = 0;
inputs[| 10].editWidget.maxx = 100;
} else
inputs[| 10].setVisible(false);
}
outputs[| 0].visible = isInLoop();
@ -736,7 +801,7 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
if(render_process_id != 0) {
var res = ProcIdExists(render_process_id);
if(res == 0) {
if(res == 0 || OS == os_macosx) {
var noti = log_message("EXPORT", $"Export {render_type} as {render_target}", THEME.noti_icon_tick, COLORS._main_value_positive, false);
noti.path = filename_dir(render_target);
noti.setOnClick(function() { shellOpenExplorer(self.path); }, "Open in explorer", THEME.explorer);

View file

@ -264,7 +264,7 @@ function valueAnimator(_val, _prop, _sep_axis = false) constructor {
var _time_last = values[| ds_list_size(values) - 1].time;
var _time_dura = _time_last - _time_first;
if(_time > _time_last) { #region //loop
if(_time > _time_last) { #region //loop time
switch(prop.on_end) {
case KEYFRAME_END.loop :
_time = _time_first + safe_mod(_time - _time_last, _time_dura + 1);
@ -281,7 +281,7 @@ function valueAnimator(_val, _prop, _sep_axis = false) constructor {
var _keyIndex;
if(_time >= _len) _keyIndex = 999_999;
else if(_time <= 0) _keyIndex = 0;
else if(_time <= 0) _keyIndex = -1;
else _keyIndex = key_map[_time];
if(_keyIndex == -1) { #region Before first key

View file

@ -66,10 +66,12 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
inputs[| 25] = nodeValue("Invert", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false );
inputs[| 26] = nodeValue("Clamp range", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false );
input_display_list = [
["Output", true], 0, 1,
["Line data", false], 6, 7, 19, 2, 20,
["Line settings", false], 17, 3, 11, 12, 8, 25, 9, 13, 14,
["Line settings", false], 17, 3, 11, 12, 8, 25, 9, 26, 13, 14,
["Wiggle", false], 4, 5,
["Render", false], 10, 24, 15, 16,
["Texture", false], 18, 21, 22, 23,
@ -125,7 +127,11 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
inputs[| 20].setVisible( _flen);
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) {
static onValueUpdate = function(index = 0) { #region
if(index == 11) ds_map_clear(widthMap);
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
#region data
var _dim = _data[0];
var _bg = _data[1];
@ -156,8 +162,9 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
var _texRot = _data[22];
var _texSca = _data[23];
var _colb = _data[24];
var _colb = _data[24];
var _ratInv = _data[25];
var _clamp = _data[26];
#endregion
if(CURRENT_FRAME == 0 || inputs[| 11].is_anim)
@ -209,10 +216,6 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
var _pathLength = _useDistance? _pat.getLength(i) : 1;
if(_pathLength == 0) continue;
var _segLength = struct_has(_pat, "getAccuLength")? _pat.getAccuLength(i) : [];
var _segLengthAmo = array_length(_segLength);
var _segIndex = 0;
var _pathStr = _rtStr;
var _pathEnd = _rtMax;
@ -223,10 +226,10 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
var _total_prev = _total; //Use to prevent infinite loop
var _freeze = 0; //Use to prevent infinite loop
var _prog_curr = frac(_shift); //Pointer to the current position
var _prog_curr = _clamp? _shift : frac(_shift); //Pointer to the current position
var _prog_next = 0;
var _prog = _prog_curr + 1; //Record previous position to delete from _total
var _prog_total = 0; //Record how far the pointer have moved so far
var _prog_total = 0; //Record the distance the pointer has moved so far
var points = is_array(lines[i])? lines[i] : [];
var pointArrLen = array_length(points);
var pointAmo = 0;
@ -244,34 +247,47 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
_prog_curr *= _pathLength;
}
while(_total >= 0) {
if(_useDistance) {
var segmentLength = _segIndex < _segLengthAmo? _segLength[_segIndex] : 99999;
_prog_next = _prog_curr % _pathLength; //Wrap overflow path
_prog_next = min(_prog_curr + _stepLen, _pathLength, segmentLength);
if(_prog_next == segmentLength)
_segIndex = (_segIndex + 1) % _segLengthAmo;
_pathPng = _ratInv? _pathLength - _prog_curr : _prog_curr;
} else {
if(_prog_curr >= 1) //Wrap overflow path
_prog_next = frac(_prog_curr);
else
_prog_next = min(_prog_curr + _stepLen, 1); //Move forward _stepLen or _total (if less) stop at 1
_pathPng = _ratInv? 1 - _prog_curr : _prog_curr;
var _segLength = struct_has(_pat, "getAccuLength")? _pat.getAccuLength(i) : [];
var _segLengthAmo = array_length(_segLength);
var _segIndex = 0;
if(_segLengthAmo)
while(_prog_curr > _segLength[_segIndex]) {
_segIndex++;
if(_segIndex == _segLengthAmo) {
_segIndex = 0;
break;
}
}
//print($"===== {_prog_curr}/{_segLength} : {_segIndex} =====");
while(_total >= 0) {
wght = 1;
if(_useDistance) {
p = _pat.getPointDistance(_pathPng, i, p);
if(struct_has(_pat, "getWeightRatio"))
wght = _pat.getWeightRatio(_pathPng, i);
} else {
p = _pat.getPointRatio(_pathPng, i, p);
var segmentLength = array_safe_get(_segLength, _segIndex, _pathLength);
_prog_next = min(_prog_curr + _stepLen, _pathLength, segmentLength);
_pathPng = _ratInv? _pathLength - _prog_curr : _prog_curr;
//print($"{segmentLength}/{_pathLength} = {_prog_next}");
if(_prog_next == segmentLength) _segIndex++;
var _pp = _clamp? clamp(_pathPng, 0, _pathLength) : _pathPng
//print($"_pp = {_pp}");
p = _pat.getPointDistance(_pp, i, p);
if(struct_has(_pat, "getWeightDistance"))
wght = _pat.getWeightDistance(_pathPng, i);
wght = _pat.getWeightDistance(_pp, i);
} else {
_prog_next = min(_prog_curr + _stepLen, 1); //Move forward _stepLen or _total (if less) stop at 1
_pathPng = _ratInv? 1 - _prog_curr : _prog_curr;
var _pp = _clamp? clamp(_pathPng, 0, 1) : _pathPng
p = _pat.getPointRatio(_pp, i, p);
if(struct_has(_pat, "getWeightRatio"))
wght = _pat.getWeightRatio(_pp, i);
}
_nx = p.x;
@ -306,7 +322,8 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
pointAmo++;
}
if(_prog_next > _prog_curr) {
if(_prog_next == _prog_curr) break;
else if(_prog_next > _prog_curr) {
_prog_total += _prog_next - _prog_curr;
_total -= _prog_next - _prog_curr;
}
@ -506,5 +523,5 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
#endregion
return _outSurf;
}
} #endregion
}

View file

@ -3,9 +3,9 @@ function Node_Mirror(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
inputs[| 1] = nodeValue("Position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0 ])
inputs[| 1] = nodeValue("Position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0.5, 0.5 ])
.setDisplay(VALUE_DISPLAY.vector)
.setUnitRef(function(index) { return getDimension(index); });
.setUnitRef(function(index) { return getDimension(index); }, VALUE_UNIT.reference);
inputs[| 2] = nodeValue("Angle", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
.setDisplay(VALUE_DISPLAY.rotation);

View file

@ -20,7 +20,7 @@ function Node_MK_Rain(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
inputs[| 6] = nodeValue("Alpha", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0.5, 1 ])
.setDisplay(VALUE_DISPLAY.slider_range);
inputs[| 7] = nodeValue("Velocity", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 2 ])
inputs[| 7] = nodeValue("Velocity", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [ 1, 2 ])
.setDisplay(VALUE_DISPLAY.vector_range);
inputs[| 8] = nodeValue("Seed", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, irandom_range(100_000, 999_999));
@ -32,10 +32,13 @@ function Node_MK_Rain(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
.setDisplay(VALUE_DISPLAY.vector_range);
inputs[| 11] = nodeValue("Texture", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone);
inputs[| 12] = nodeValue("Track extension", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0 ])
.setDisplay(VALUE_DISPLAY.slider_range, { range: [ 0, 10, 0.01 ] });
input_display_list = [ new Inspector_Sprite(s_MKFX), 0, 8,
["Shape", false], 9, 3, 4, 10, 11,
["Effect", false], 2, 1, 7,
["Effect", false], 2, 1, 7, 12,
["Render", false], 5, 6,
];
@ -63,10 +66,10 @@ function Node_MK_Rain(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
var _shap = _data[9];
var _snws = _data[10];
var _text = _data[11];
var _trex = _data[12];
if(!is_surface(_surf)) return _outSurf;
if(_shap == 2 && !is_surface(_text)) return _outSurf;
random_set_seed(_seed);
var _sw = surface_get_width_safe(_surf);
var _sh = surface_get_height_safe(_surf);
@ -97,8 +100,11 @@ function Node_MK_Rain(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
if(_1c) draw_set_color(_cc);
BLEND_ALPHA_MULP
repeat(_dens) {
var _r_shf = random_range(-_rad, _rad);
var _y_shf = random(1);
random_set_seed(_seed); _seed += 100;
var _rrad = _rad * (1 + random_range(_trex[0], _trex[1]));
var _r_shf = random_range( -_rad, _rad);
var _y_shf = random(1);
var _drpW, _drpH, _drpS;
switch(_shap) {
@ -119,11 +125,11 @@ function Node_MK_Rain(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
var _rmx = _rx + _in_span_x * _r_shf;
var _rmy = _ry + _in_span_y * _r_shf;
var _radH = _rad + _drpH;
var _radH = _rrad + _drpH;
var _radHx = _radH * _tr_span_x;
var _radHy = _radH * _tr_span_y;
var _vel = irandom_range(_velo[0], _velo[1]);
var _vel = max(1, irandom_range(_velo[0], _velo[1]));
var _prg = _y_shf + _vel * prg;
_prg = frac(_prg) - 0.5;
@ -145,6 +151,7 @@ function Node_MK_Rain(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
);
break;
case 1 :
//draw_circle(round(_drpX), round(_drpY), _drpW, false);
draw_circle(_drpX, _drpY, _drpW, false);
break;
case 2 :

View file

@ -0,0 +1,101 @@
enum MKSPARK_DRAW {
dot,
trail
}
function Node_MK_Sparkle(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
name = "MK Sparkle";
dimension_index = -1;
update_on_frame = true;
inputs[| 0] = nodeValue("Size", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 4);
inputs[| 1] = nodeValue("Sparkle", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [
[ 0, 0, 2, MKSPARK_DRAW.trail, BLEND.add, 0 ],
[ 0, -1, 1, MKSPARK_DRAW.trail, BLEND.subtract, 0 ],
[ 1, 0, 2, MKSPARK_DRAW.trail, BLEND.add, -2 ],
[ 1, -1, 2, MKSPARK_DRAW.trail, BLEND.subtract, -2 ],
])
.setArrayDepth(2);
inputs[| 2] = nodeValue("Start frame", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0);
sparkleEditor = new Inspector_Custom_Renderer(function(_x, _y, _w, _m, _hover, _focus) { #region
var _sprk = inputs[| 1].getValue();
var h = array_length(_sprk) * 32 + 16;
return h;
}); #endregion
input_display_list = [ new Inspector_Sprite(s_MKFX), 0, 2,
sparkleEditor
];
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
temp_surface = [ noone, noone ];
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
var _size = _data[0];
var _sprk = _data[1];
var _frme = _data[2];
if(array_empty(_sprk)) return _outSurf;
var _s = _size * 2 + 1;
_outSurf = surface_verify(_outSurf, _s, _s);
temp_surface[0] = surface_verify(temp_surface[0], _s, _s);
temp_surface[1] = surface_verify(temp_surface[1], _s, _s);
var _s0 = temp_surface[0];
var _s1 = temp_surface[1];
var _fr = CURRENT_FRAME - _frme + 1;
surface_set_target(_s0);
DRAW_CLEAR
draw_set_color(c_white);
for( var i = 0, n = array_length(_sprk); i < n; i++ ) {
var _sk = _sprk[i];
var sy = _size + _sk[0];
var sx = _size + _sk[1];
var sp = _sk[2];
var ff = _fr + _sk[5];
if(ff < 0) continue;
switch(_sk[4]) {
case BLEND.add : BLEND_ADD; break;
case BLEND.subtract : BLEND_SUBTRACT; break;
}
switch(_sk[3]) {
case MKSPARK_DRAW.dot : draw_point(sx + ff * sp, sy); break;
case MKSPARK_DRAW.trail : draw_line(sx - 1, sy, sx - 1 + ff * sp, sy); break;
}
}
BLEND_NORMAL
surface_reset_target();
surface_set_target(_s1);
DRAW_CLEAR
draw_surface_ext(_s0, 0, 0, 1, 1, 0, c_white, 1);
draw_surface_ext(_s0, 0, _s, 1, -1, 0, c_white, 1);
surface_reset_target();
surface_set_target(_outSurf);
DRAW_CLEAR
draw_surface_ext(_s1, 0, 0, 1, 1, 0, c_white, 1);
draw_surface_ext(_s1, 0, _s, 1, 1, 90, c_white, 1);
draw_surface_ext(_s1, _s, _s, 1, 1, 180, c_white, 1);
draw_surface_ext(_s1, _s, 0, 1, 1, 270, c_white, 1);
surface_reset_target();
return _outSurf;
} #endregion
}

View file

@ -0,0 +1,11 @@
{
"resourceType": "GMScript",
"resourceVersion": "1.0",
"name": "node_mk_sparkle",
"isCompatibility": false,
"isDnD": false,
"parent": {
"name": "MK effects",
"path": "folders/nodes/data/MK effects.yy",
},
}

View file

@ -116,9 +116,7 @@ function Node_Number(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
if(inputs[| 0].value_from != noone || disp == 0) { #region
draw_set_text(f_sdf, fa_center, fa_center, COLORS._main_text);
var str = string(val);
var ss = string_scale(str, bbox.w, bbox.h);
draw_text_transformed(bbox.xc, bbox.yc, str, ss, ss, 0);
draw_text_bbox(bbox, string(val));
return;
} #endregion

View file

@ -617,12 +617,13 @@ function __initNodes() {
addNodeObject(generator, "Flood Fill", s_node_flood_fill, "Node_Flood_Fill", [1, Node_Flood_Fill],, "Filled connected pixel given position and color.").setVersion(1133);
ds_list_add(generator, "MK Effects");
addNodeObject(generator, "MK Rains", s_node_mk_rain, "Node_MK_Rain", [1, Node_MK_Rain]).setVersion(11600);
addNodeObject(generator, "MK Rain", s_node_mk_rain, "Node_MK_Rain", [1, Node_MK_Rain]).setVersion(11600);
addNodeObject(generator, "MK GridBalls", s_node_mk_ball_grid, "Node_MK_GridBalls", [1, Node_MK_GridBalls]).setVersion(11600);
addNodeObject(generator, "MK GridFlip", s_node_mk_flip_grid, "Node_MK_GridFlip", [1, Node_MK_GridFlip]).setVersion(11600);
addNodeObject(generator, "MK Saber", s_node_mk_saber, "Node_MK_Saber", [1, Node_MK_Saber]).setVersion(11600);
addNodeObject(generator, "MK Tile", s_node_mk_tile, "Node_MK_Tile", [1, Node_MK_Tile]).setVersion(11600);
addNodeObject(generator, "MK Flag", s_node_mk_flag, "Node_MK_Flag", [1, Node_MK_Flag]).setVersion(11600);
if(TESTING) addNodeObject(generator, "MK Sparkle", s_node_mk_sparkle, "Node_MK_Sparkle", [1, Node_MK_Sparkle]).setVersion(11600);
#endregion
var compose = ds_list_create(); #region

View file

@ -25,6 +25,8 @@ function Node_Stack(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
outputs[| 1] = nodeValue("Atlas data", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, []);
temp_surface = [ noone, noone ];
attribute_surface_depth();
static refreshDynamicInput = function() { #region
@ -90,55 +92,78 @@ function Node_Stack(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
}
var _outSurf = outputs[| 0].getValue();
_outSurf = surface_verify(_outSurf, ww, hh, attrDepth());
outputs[| 0].setValue(_outSurf);
_outSurf = surface_verify(_outSurf, ww, hh, attrDepth());
temp_surface[0] = surface_verify(temp_surface[0], ww, hh, attrDepth());
temp_surface[1] = surface_verify(temp_surface[1], ww, hh, attrDepth());
surface_set_target(temp_surface[0]); DRAW_CLEAR surface_reset_target();
surface_set_target(temp_surface[1]); DRAW_CLEAR surface_reset_target();
var atlas = [];
var ppind = 0;
var sx = 0, sy = 0;
for( var i = input_fix_len; i < ds_list_size(inputs) - 1; i++ ) {
var _surf = getInputData(i);
if(!is_array(_surf)) _surf = [ _surf ];
for( var j = 0; j < array_length(_surf); j++ ) {
if(!is_surface(_surf[j])) continue;
var sw = surface_get_width_safe(_surf[j]);
var sh = surface_get_height_safe(_surf[j]);
if(_axis == 0) {
switch(_alig) {
case fa_left: sy = 0; break;
case fa_center: sy = hh / 2 - sh / 2; break;
case fa_right: sy = hh - sh; break;
}
} else if(_axis == 1) {
switch(_alig) {
case fa_left: sx = 0; break;
case fa_center: sx = ww / 2 - sw / 2; break;
case fa_right: sx = ww - sw; break;
}
} else if(_axis == 2) {
sx = ww / 2 - sw / 2;
sy = hh / 2 - sh / 2;
}
array_push(atlas, new SurfaceAtlas(_surf[j], sx, sy));
surface_set_shader(temp_surface[!ppind], sh_draw_surface);
DRAW_CLEAR
BLEND_OVERRIDE
shader_set_f("dimension", ww, hh);
shader_set_surface("fore", _surf[j]);
shader_set_f("fdimension", sw, sh);
shader_set_f("position", sx, sy);
draw_surface(temp_surface[ppind], 0, 0);
BLEND_NORMAL
surface_reset_shader();
ppind = !ppind;
if(_axis == 0)
sx += sw + _spac;
else if(_axis == 1)
sy += sh + _spac;
}
}
surface_set_target(_outSurf);
DRAW_CLEAR
BLEND_ALPHA_MULP
DRAW_CLEAR
BLEND_OVERRIDE
var sx = 0, sy = 0;
for( var i = input_fix_len; i < ds_list_size(inputs) - 1; i++ ) {
var _surf = getInputData(i);
if(!is_array(_surf)) _surf = [ _surf ];
for( var j = 0; j < array_length(_surf); j++ ) {
if(!is_surface(_surf[j])) continue;
var sw = surface_get_width_safe(_surf[j]);
var sh = surface_get_height_safe(_surf[j]);
if(_axis == 0) {
switch(_alig) {
case fa_left: sy = 0; break;
case fa_center: sy = hh / 2 - sh / 2; break;
case fa_right: sy = hh - sh; break;
}
} else if(_axis == 1) {
switch(_alig) {
case fa_left: sx = 0; break;
case fa_center: sx = ww / 2 - sw / 2; break;
case fa_right: sx = ww - sw; break;
}
} else if(_axis == 2) {
sx = ww / 2 - sw / 2;
sy = hh / 2 - sh / 2;
}
array_push(atlas, new SurfaceAtlas(_surf[j], sx, sy));
draw_surface_safe(_surf[j], sx, sy);
if(_axis == 0)
sx += sw + _spac;
else if(_axis == 1)
sy += sh + _spac;
}
}
draw_surface(temp_surface[ppind], 0, 0);
BLEND_NORMAL;
BLEND_NORMAL
surface_reset_target();
outputs[| 0].setValue(_outSurf);
outputs[| 1].setValue(atlas);
} #endregion
}

View file

@ -92,7 +92,7 @@ function Node_Surface_Replace(_x, _y, _group = noone) : Node_Processor(_x, _y, _
temp_surface[0] = surface_verify(temp_surface[0], surface_get_width_safe(_bas), surface_get_height_safe(_bas));
surface_set_target(temp_surface[0]);
DRAW_CLEAR;
DRAW_CLEAR
surface_reset_target();
var amo = array_length(_tar);
@ -102,7 +102,7 @@ function Node_Surface_Replace(_x, _y, _group = noone) : Node_Processor(_x, _y, _
_outSurf = surface_verify(_outSurf, surface_get_width_safe(_bas), surface_get_height_safe(_bas));
surface_set_target(_outSurf);
DRAW_CLEAR;
DRAW_CLEAR
if(_drw) draw_surface_safe(_bas);
surface_reset_target();

View file

@ -1422,9 +1422,11 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
if(display_type == VALUE_DISPLAY.d3quarternion) { #region
if(!applyUnit) return value;
var dispType = struct_try_get(nodeFrom.display_data, "angle_display");
var dispType = struct_try_get(display_data, "angle_display");
switch(dispType) {
case QUARTERNION_DISPLAY.quarterion : return value;
case QUARTERNION_DISPLAY.quarterion :
return value;
case QUARTERNION_DISPLAY.euler :
var euler = new BBMOD_Quaternion().FromEuler(value[0], value[1], value[2]).ToArray();
return euler;

View file

@ -433,7 +433,7 @@ function Panel_Menu() : PanelContent() constructor {
xx += ww + 8;
_mx = max(_mx, xx);
_ww += ww + 8;
if(_ww > w * 0.4 - sx) {
if(_ww > w * 0.6 - sx) {
_curRow++;
_ww = 0;
xx = sx;

View file

@ -83,7 +83,7 @@
PREFERENCES.show_supporter_icon = true;
PREFERENCES.temp_path = "%DIR%/temp/";
PREFERENCES.ImageMagick_path = "%APP%/ImageMagick/";
PREFERENCES.ImageMagick_path = "%APP%/imagemagick/";
PREFERENCES.webp_path = "%APP%/webp/";
PREFERENCES.gifski_path = "%APP%/gifski/";
PREFERENCES.ffmpeg_path = "%APP%/ffmpeg/";
@ -219,6 +219,7 @@
PREFERENCES.double_click_delay /= 60;
TESTING = struct_try_get(PREFERENCES, "test_mode", false);
if(TESTING) log_message("PREFERENCE", "Test mode enabled");
if(PREFERENCES.use_legacy_exception) resetException();
else setException();

View file

@ -71,7 +71,7 @@ function quarternionBox(_onModify) : widget() constructor {
var _disp = struct_try_get(_display_data, "angle_display");
tooltip.index = _disp;
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, active, hover, tooltip, THEME.unit_angle, _disp, c_white) == 2) {
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, iactive, ihover, tooltip, THEME.unit_angle, _disp, c_white) == 2) {
clickable = false;
_display_data.angle_display = (_disp + 1) % 2;
}

View file

@ -102,8 +102,8 @@ function scrollBox(_data, _onModify, update_hover = true) : widget() constructor
draw_set_text(font, align, fa_center, COLORS._main_text);
draw_set_alpha(0.5 + 0.5 * interactable);
if(align == fa_center) draw_text(_x + (w - _arw) / 2, _y + _h / 2 - ui(2), _text);
else if(align == fa_left) draw_text(_x + ui(8) + _spr * _h, _y + _h / 2 - ui(2), _text);
if(align == fa_center) draw_text_add(_x + (w - _arw) / 2, _y + _h / 2, _text);
else if(align == fa_left) draw_text_add(_x + ui(8) + _spr * _h, _y + _h / 2, _text);
draw_set_alpha(1);
if(_spr) draw_sprite_ext(_selVal.spr, 0, _x + ui(8) + _h / 2, _y + _h / 2, 1, 1, 0, _selVal.spr_blend, 1);

View file

@ -163,6 +163,7 @@ function shader_set_palette(pal, pal_uni = "palette", amo_uni = "paletteAmount",
over,
alpha,
alphamulp,
subtract,
}
function shader_preset_interpolation(shader = sh_sample) {

View file

@ -12,8 +12,14 @@ function shellOpenExplorer(path) { #region
function shell_execute(path, command, ref = noone) { #region
INLINE
if(OS == os_macosx) {
path = string_replace_all(path, "\\", "/");
command = string_replace_all(command, "\\", "/");
}
var txt = $"{path} {command}";
var res = ProcessExecute(txt);
print($"Execute {path} {command} | {res}");
return res;
} #endregion
@ -21,8 +27,14 @@ function shell_execute(path, command, ref = noone) { #region
function shell_execute_async(path, command, ref = noone) { #region
INLINE
if(OS == os_macosx) {
path = string_replace_all(path, "\\", "/");
command = string_replace_all(command, "\\", "/");
}
var txt = $"{path} {command}";
var res = ProcessExecuteAsync(txt);
print($"Execute async {path} {command} | {res}");
return res;
} #endregion

View file

@ -150,6 +150,32 @@ function surface_save_safe(surface, path) {
return;
}
function surface_cvt_8unorm(target, surface) { #region
if(!is_surface(surface)) return target;
target = surface_verify(target, surface_get_width_safe(surface), surface_get_height_safe(surface));
var _typ = surface_get_format(surface);
switch(_typ) {
case surface_rgba4unorm :
case surface_rgba8unorm :
case surface_rgba16float :
case surface_rgba32float :
surface_set_shader(target, sh_draw_normal);
break;
case surface_r8unorm :
case surface_r16float :
case surface_r32float :
surface_set_shader(target, sh_draw_single_channel);
break;
}
draw_surface(surface, 0, 0);
surface_reset_shader();
return target;
} #endregion
function surface_get_width_safe(s, crop = true) {
INLINE
@ -307,7 +333,7 @@ function surface_size_lim(surface, width, height) {
var ss = min(width / sw, height / sh);
var s = surface_create(max(1, sw * ss), max(1, sh * ss));
surface_set_target(s);
DRAW_CLEAR;
DRAW_CLEAR
draw_surface_ext_safe(surface, 0, 0, ss, ss, 0, c_white, 1);
surface_reset_target();
return s;

View file

@ -542,7 +542,7 @@ function textArea(_input, _onModify) : textInput(_input, _onModify) constructor
onModified();
}
if(auto_update && keyboard_check_pressed(vk_anykey))
if(auto_update && (keyboard_check_pressed(vk_anykey) || modified))
apply();
if(keyboard_check_pressed(vk_left)) onKey(vk_left);

View file

@ -148,6 +148,8 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor {
} #endregion
static editText = function() { #region
var edited = false;
#region text editor
if(key_mod_press(CTRL) && keyboard_check_pressed(ord("A"))) {
cursor_select = 0;
@ -159,9 +161,11 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor {
clipboard_set_text(string_copy(_input_text, minc, maxc - minc));
}
} else {
if(key_mod_press(CTRL) && keyboard_check_pressed(ord("V")))
if(key_mod_press(CTRL) && keyboard_check_pressed(ord("V"))) {
KEYBOARD_STRING = clipboard_get_text();
edited = true;
}
if(keyboard_check_pressed(vk_escape) || keyboard_check_pressed(vk_enter)) {
} else if(KEYBOARD_PRESSED == vk_backspace) {
if(cursor_select == -1) {
@ -195,6 +199,7 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor {
_input_text = str_before + str_after;
}
edited = true;
cursor_select = -1;
move_cursor(-1);
} else if(KEYBOARD_PRESSED == vk_delete || (keyboard_check_pressed(ord("X")) && key_mod_press(CTRL) && cursor_select != -1)) {
@ -213,6 +218,8 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor {
cursor = minc;
_input_text = str_before + str_after;
}
edited = true;
cursor_select = -1;
} else if(KEYBOARD_STRING != "") {
var ch = KEYBOARD_STRING;
@ -234,6 +241,7 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor {
cursor = minc + string_length(ch);
}
edited = true;
cursor_select = -1;
}
}
@ -273,7 +281,7 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor {
deactivate();
} else if(keyboard_check_pressed(vk_enter))
deactivate();
else if(auto_update && keyboard_check_pressed(vk_anykey))
else if(auto_update && (edited || keyboard_check_pressed(vk_anykey)))
apply();
} #endregion
@ -414,7 +422,7 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor {
var txt = _input_text;
draw_set_text(font == noone? f_p0 : font, fa_left, fa_top);
var tw = string_width(txt);
var th = string_height(txt);
var th = string_height(txt == ""? "l" : txt);
var cs = string_copy(txt, 1, cursor);
var c_w = string_width(cs);
@ -444,7 +452,7 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor {
if(cursor_pos_to > _x + _w - ui(16))
disp_x_to -= _w - ui(16);
cursor_pos = cursor_pos == 0? cursor_pos_to : lerp_float(cursor_pos, cursor_pos_to, 2);
cursor_pos = cursor_pos == 0? cursor_pos_to : lerp_float(cursor_pos, cursor_pos_to, 2);
if(cursor_select > -1) { //draw highlight
draw_set_color(COLORS.widget_text_highlight);
@ -469,7 +477,7 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor {
BLEND_ALPHA
draw_surface(text_surface, tb_surf_x, tb_surf_y);
BLEND_NORMAL
draw_set_color(COLORS._main_text_accent);
draw_line_width(cursor_pos, c_y0, cursor_pos, c_y1, 2);
#endregion

View file

@ -1,4 +1,4 @@
function file_read_all(path) {
function file_read_all(path) { #region
INLINE
var f = file_text_open_read(path);
@ -7,9 +7,9 @@ function file_read_all(path) {
s += string(file_text_readln(f));
file_text_close(f);
return s;
}
} #endregion
function file_text_read_all_lines(path) {
function file_text_read_all_lines(path) { #region
INLINE
var f = file_text_open_read(path);
@ -18,9 +18,9 @@ function file_text_read_all_lines(path) {
array_push(s, file_text_readln(f));
file_text_close(f);
return s;
}
} #endregion
function file_text_write_all(path, str) {
function file_text_write_all(path, str) { #region
INLINE
if(file_exists_empty(path)) file_delete(path);
@ -28,4 +28,4 @@ function file_text_write_all(path, str) {
var f = file_text_open_write(path);
file_text_write_string(f, str);
file_text_close(f);
}
} #endregion

View file

@ -9,8 +9,7 @@ attribute vec2 in_TextureCoord; // (u,v)
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
void main()
{
void main() {
vec4 object_space_pos = vec4( in_Position.x, in_Position.y, in_Position.z, 1.0);
gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * object_space_pos;

View file

@ -6,5 +6,5 @@ varying vec4 v_vColour;
void main() {
vec4 basecolor = texture2D( gm_BaseTexture, v_vTexcoord );
gl_FragColor = basecolor * v_vColour;
gl_FragColor = basecolor;
}

View file

@ -0,0 +1,11 @@
{
"type": 1,
"parent": {
"name": "shader",
"path": "folders/shader.yy",
},
"resourceVersion": "1.0",
"name": "sh_blend_multiply",
"tags": [],
"resourceType": "GMShader",
}

View file

@ -0,0 +1,30 @@
//
// Simple passthrough fragment shader
//
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
uniform sampler2D fore;
uniform vec2 dimension;
uniform vec2 fdimension;
uniform vec2 position;
void main() {
vec2 px = v_vTexcoord * dimension;
vec2 fpx = px - position;
vec2 ftx = fpx / fdimension;
vec4 _cBg = texture2D( gm_BaseTexture, v_vTexcoord );
if(ftx.x < 0. || ftx.y < 0. || ftx.x > 1. || ftx.y > 1.) {
gl_FragColor = _cBg;
return;
}
vec4 _cFg = texture2D( fore, ftx );
float al = _cFg.a + _cBg.a * (1. - _cFg.a);
vec4 res = (_cFg * _cFg.a) + (_cBg * _cBg.a * (1. - _cFg.a));
res = vec4(res.rgb / al, al);
gl_FragColor = res;
}

View file

@ -0,0 +1,18 @@
//
// Simple passthrough vertex shader
//
attribute vec3 in_Position; // (x,y,z)
//attribute vec3 in_Normal; // (x,y,z) unused in this shader.
attribute vec4 in_Colour; // (r,g,b,a)
attribute vec2 in_TextureCoord; // (u,v)
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
void main() {
vec4 object_space_pos = vec4( in_Position.x, in_Position.y, in_Position.z, 1.0);
gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * object_space_pos;
v_vColour = in_Colour;
v_vTexcoord = in_TextureCoord;
}

View file

@ -0,0 +1,10 @@
{
"resourceType": "GMShader",
"resourceVersion": "1.0",
"name": "sh_draw_surface",
"parent": {
"name": "blend",
"path": "folders/shader/blend.yy",
},
"type": 1,
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -0,0 +1,74 @@
{
"resourceType": "GMSprite",
"resourceVersion": "1.0",
"name": "s_node_mk_sparkle",
"bbox_bottom": 63,
"bbox_left": 0,
"bbox_right": 63,
"bbox_top": 0,
"bboxMode": 0,
"collisionKind": 1,
"collisionTolerance": 0,
"DynamicTexturePage": false,
"edgeFiltering": false,
"For3D": false,
"frames": [
{"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"157d4a80-8ed1-4afa-a437-f8d7aa8fb963",},
],
"gridX": 0,
"gridY": 0,
"height": 64,
"HTile": false,
"layers": [
{"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"53804f42-193f-490a-a41f-76b4a67e21f0","blendMode":0,"displayName":"default","isLocked":false,"opacity":100.0,"visible":true,},
],
"nineSlice": null,
"origin": 4,
"parent": {
"name": "MK effects",
"path": "folders/nodes/icons/MK effects.yy",
},
"preMultiplyAlpha": false,
"sequence": {
"resourceType": "GMSequence",
"resourceVersion": "1.4",
"name": "s_node_mk_sparkle",
"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":"157d4a80-8ed1-4afa-a437-f8d7aa8fb963","path":"sprites/s_node_mk_sparkle/s_node_mk_sparkle.yy",},},},"Disabled":false,"id":"b9d19115-baa7-455a-ab7f-b1278e608f4b","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,
}