MK GridBalls

This commit is contained in:
Tanasart 2023-12-01 11:49:44 +07:00
parent fd3d21b001
commit d392a4341a
18 changed files with 415 additions and 69 deletions

View file

@ -167,6 +167,7 @@
{"name":"generator","order":142,"path":"folders/nodes/icons/generator.yy",},
{"name":"IO","order":143,"path":"folders/nodes/icons/IO.yy",},
{"name":"misc","order":139,"path":"folders/nodes/icons/misc.yy",},
{"name":"MK effects","order":151,"path":"folders/nodes/icons/MK effects.yy",},
{"name":"pixel builder","order":149,"path":"folders/nodes/icons/pixel builder.yy",},
{"name":"render","order":140,"path":"folders/nodes/icons/render.yy",},
{"name":"rigidSim","order":146,"path":"folders/nodes/icons/rigidSim.yy",},
@ -242,7 +243,7 @@
{"name":"button","order":34,"path":"folders/widgets/button.yy",},
{"name":"rotator","order":35,"path":"folders/widgets/rotator.yy",},
{"name":"text","order":36,"path":"folders/widgets/text.yy",},
{"name":"MK effects","order":151,"path":"folders/nodes/icons/MK effects.yy",},
{"name":"MK effects","order":22,"path":"folders/shader/MK effects.yy",},
],
"ResourceOrderSettings": [
{"name":"s_node_corner","order":16,"path":"sprites/s_node_corner/s_node_corner.yy",},
@ -1524,6 +1525,7 @@
{"name":"s_node_smokeSim_update_paused","order":5,"path":"sprites/s_node_smokeSim_update_paused/s_node_smokeSim_update_paused.yy",},
{"name":"s_node_ase_file","order":15,"path":"sprites/s_node_ase_file/s_node_ase_file.yy",},
{"name":"draw_line_round","order":4,"path":"scripts/draw_line_round/draw_line_round.yy",},
{"name":"s_node_mk_ball_grid","order":1,"path":"sprites/s_node_mk_ball_grid/s_node_mk_ball_grid.yy",},
{"name":"vectorBox","order":10,"path":"scripts/vectorBox/vectorBox.yy",},
{"name":"sh_3d_extrude_corner","order":7,"path":"shaders/sh_3d_extrude_corner/sh_3d_extrude_corner.yy",},
{"name":"sh_blend_normal_dim","order":10,"path":"shaders/sh_blend_normal_dim/sh_blend_normal_dim.yy",},

View file

@ -197,6 +197,7 @@
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"generator","folderPath":"folders/nodes/icons/generator.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"IO","folderPath":"folders/nodes/icons/IO.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"misc","folderPath":"folders/nodes/icons/misc.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"MK effects","folderPath":"folders/nodes/icons/MK effects.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"pixel builder","folderPath":"folders/nodes/icons/pixel builder.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"render","folderPath":"folders/nodes/icons/render.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"rigidSim","folderPath":"folders/nodes/icons/rigidSim.yy",},
@ -277,7 +278,7 @@
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"button","folderPath":"folders/widgets/button.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"rotator","folderPath":"folders/widgets/rotator.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"text","folderPath":"folders/widgets/text.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"MK effects","folderPath":"folders/nodes/icons/MK effects.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"MK effects","folderPath":"folders/shader/MK effects.yy",},
],
"IncludedFiles": [
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ApolloHelp.html","ConfigValues":{"Itch":{"CopyToMask":"0",},},"CopyToMask":-1,"filePath":"datafiles",},
@ -1173,6 +1174,7 @@
{"id":{"name":"o_dialog_scrollbox","path":"objects/o_dialog_scrollbox/o_dialog_scrollbox.yy",},},
{"id":{"name":"s_node_palette","path":"sprites/s_node_palette/s_node_palette.yy",},},
{"id":{"name":"curve_damping_function","path":"scripts/curve_damping_function/curve_damping_function.yy",},},
{"id":{"name":"sh_mk_ballGrid","path":"shaders/sh_mk_ballGrid/sh_mk_ballGrid.yy",},},
{"id":{"name":"fd_rectangle_get_collision_mask_surface","path":"scripts/fd_rectangle_get_collision_mask_surface/fd_rectangle_get_collision_mask_surface.yy",},},
{"id":{"name":"s_node_strandSim_length","path":"sprites/s_node_strandSim_length/s_node_strandSim_length.yy",},},
{"id":{"name":"node_pb_fx_substract","path":"scripts/node_pb_fx_substract/node_pb_fx_substract.yy",},},
@ -1904,7 +1906,7 @@
{"id":{"name":"_f_p0b","path":"fonts/_f_p0b/_f_p0b.yy",},},
{"id":{"name":"s_node_armature_pose","path":"sprites/s_node_armature_pose/s_node_armature_pose.yy",},},
{"id":{"name":"sh_fd_visualize_pressure_glsl","path":"shaders/sh_fd_visualize_pressure_glsl/sh_fd_visualize_pressure_glsl.yy",},},
{"id":{"name":"node_mk_balls","path":"scripts/node_mk_balls/node_mk_balls.yy",},},
{"id":{"name":"node_mk_grid_balls","path":"scripts/node_mk_grid_balls/node_mk_grid_balls.yy",},},
{"id":{"name":"s_node_rigidSim_force","path":"sprites/s_node_rigidSim_force/s_node_rigidSim_force.yy",},},
{"id":{"name":"fd_rectangle_set_acceleration","path":"scripts/fd_rectangle_set_acceleration/fd_rectangle_set_acceleration.yy",},},
{"id":{"name":"s_node_vec2","path":"sprites/s_node_vec2/s_node_vec2.yy",},},
@ -2273,6 +2275,7 @@
{"id":{"name":"s_node_smokeSim_update_paused","path":"sprites/s_node_smokeSim_update_paused/s_node_smokeSim_update_paused.yy",},},
{"id":{"name":"s_node_ase_file","path":"sprites/s_node_ase_file/s_node_ase_file.yy",},},
{"id":{"name":"draw_line_round","path":"scripts/draw_line_round/draw_line_round.yy",},},
{"id":{"name":"s_node_mk_ball_grid","path":"sprites/s_node_mk_ball_grid/s_node_mk_ball_grid.yy",},},
{"id":{"name":"vectorBox","path":"scripts/vectorBox/vectorBox.yy",},},
{"id":{"name":"sh_3d_extrude_corner","path":"shaders/sh_3d_extrude_corner/sh_3d_extrude_corner.yy",},},
{"id":{"name":"sh_blend_normal_dim","path":"shaders/sh_blend_normal_dim/sh_blend_normal_dim.yy",},},

View file

@ -156,7 +156,7 @@ event_inherited();
draw_sprite_stretched_ext(THEME.node_active, 0, _boxx, yy, grid_width, grid_heigh, COLORS._main_accent, 1);
if(mouse_press(mb_left, sFOCUS)) {
LOAD_PATH(_project.path, true);
PROJECT.thumbnail = _project.spr_path[0];
PROJECT.thumbnail = array_safe_get(_project.spr_path, 0);
if(txt == "Workshop") {
PROJECT.meta.file_id = _meta.file_id;

View file

@ -13,9 +13,9 @@
if(string(home_dir) == "0")
log_message("DIRECTORY", "Directory not found.");
else
APP_DIRECTORY = string(home_dir) + "/PixelComposer/";
APP_DIRECTORY = $"{home_dir}/PixelComposer/";
}
show_debug_message("App directory: " + string(APP_DIRECTORY));
show_debug_message($"App directory: {APP_DIRECTORY}");
directory_verify(APP_DIRECTORY);
@ -25,29 +25,29 @@
DIRECTORY = struct_has(PRESIST_PREF, "path")? PRESIST_PREF.path : "";
}
show_debug_message("Env directory: " + string(DIRECTORY));
show_debug_message($"Env directory: {DIRECTORY}");
var dir_valid = DIRECTORY != "" && directory_exists(DIRECTORY);
var tmp = file_text_open_write(DIRECTORY + "val_check.txt");
if(tmp == -1) {
dir_valid = false;
print("WARNING: Inaccessible directory [" + DIRECTORY + "] this may be caused by non existing folder, or Pixel Composer has no permission to open the folder.");
show_message($"WARNING: Inaccessible main directory ({DIRECTORY}) this may be caused by non existing folder, or Pixel Composer has no permission to open the folder.");
} else {
file_text_close(tmp);
file_delete(DIRECTORY + "val_check.txt");
file_delete($"{DIRECTORY}val_check.txt");
}
if(!dir_valid) DIRECTORY = APP_DIRECTORY;
if(!dir_valid) {
show_debug_message("Invalid directory revert back to default %APPDATA%");
DIRECTORY = APP_DIRECTORY;
}
PRESIST_PREF.path = DIRECTORY;
json_save_struct(perstPath, PRESIST_PREF);
directory_verify(DIRECTORY);
//directory_set_current_working(DIRECTORY);
APP_LOCATION = program_directory;
if(string_pos("GameMakerStudio2\\Cache\\runtimes", APP_LOCATION))
APP_LOCATION = working_directory;
//print($"===================== WORKING DIRECTORIES =====================\n\t{working_directory}\n\t{DIRECTORY}");
print($"===================== WORKING DIRECTORIES =====================\n\t{working_directory}\n\t{DIRECTORY}");
#endregion
#region Set up

View file

@ -1058,6 +1058,9 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
if(high) {
jun.draw_blend_color = bg;
jun.draw_blend = PREFERENCES.connection_line_highlight_fade;
} else {
jun.draw_blend_color = bg;
jun.draw_blend = -1;
}
}
@ -1079,6 +1082,9 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
if(high) {
jun.draw_blend_color = bg;
jun.draw_blend = PREFERENCES.connection_line_highlight_fade;
} else {
jun.draw_blend_color = bg;
jun.draw_blend = -1;
}
if(is_instanceof(jun, NodeModule)) {

View file

@ -1,16 +0,0 @@
function Node_MK_Balls(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
name = "Pixel Cloud";
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
input_display_list = [ ];
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
attribute_surface_depth();
static processData = function(_outSurf, _data, _output_index, _array_index) {
var _sed = _data[0];
return _outSurf;
}
}

View file

@ -0,0 +1,183 @@
function Node_MK_GridBalls(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
name = "MK GridBalls";
inputs[| 0] = nodeValue("Surfce in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
inputs[| 1] = nodeValue("Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, DEF_SURF)
.setDisplay(VALUE_DISPLAY.vector);
inputs[| 2] = nodeValue("Amount", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [ 4, 4 ])
.setDisplay(VALUE_DISPLAY.vector);
inputs[| 3] = nodeValue("Light", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
.setDisplay(VALUE_DISPLAY.rotation);
inputs[| 4] = nodeValue("Scatter", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0);
inputs[| 5] = nodeValue("Seed", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, irandom_range(100000, 999999));
inputs[| 6] = nodeValue("Shading", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.5)
.setDisplay(VALUE_DISPLAY.slider);
inputs[| 7] = nodeValue("Scatter direction", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
.setDisplay(VALUE_DISPLAY.rotation);
inputs[| 8] = nodeValue("Shift", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0 ])
.setDisplay(VALUE_DISPLAY.vector);
inputs[| 9] = nodeValue("Stretch", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0);
inputs[| 10] = nodeValue("Stretch direction", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
.setDisplay(VALUE_DISPLAY.rotation);
inputs[| 11] = nodeValue("Stretch shift", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
.setDisplay(VALUE_DISPLAY.slider, { range: [ -1, 1, 0.01 ] });
inputs[| 12] = nodeValue("Roundness", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1)
.setDisplay(VALUE_DISPLAY.slider);
inputs[| 13] = nodeValue("Twist", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0);
inputs[| 14] = nodeValue("Twist axis", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
.setDisplay(VALUE_DISPLAY.rotation);
inputs[| 15] = nodeValue("Twist shift", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
.setDisplay(VALUE_DISPLAY.slider, { range: [ -1, 1, 0.01 ] });
input_display_list = [ 5, 1,
["Surface", true], 0,
["Grid", false], 2,
["Movement", false], 8, 4, 7, 9, 10, 11, 13, 14, 15,
["Render", false], 12, 3, 6,
];
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
attribute_surface_depth();
dimension_index = 1;
balls = [];
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
inputs[| 8].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
}
static processData = function(_outSurf, _data, _output_index, _array_index) {
var _surf = _data[0];
var _dim = _data[1];
var _bamo = _data[2];
var _ldir = _data[3];
var _scat = _data[4];
var _seed = _data[5];
var _shad = _data[6];
var _rota = _data[7];
var _posi = _data[8];
var _strh = _data[ 9];
var _strh_dir = _data[10];
var _strh_shf = _data[11];
var _rond = _data[12];
var _twst = _data[13];
var _twst_axs = _data[14];
var _twst_shf = _data[15];
if(!is_surface(_surf)) return _outSurf;
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1]);
random_set_seed(_seed);
var _sw = _dim[0];
var _sh = _dim[1];
var _row = _bamo[0];
var _col = _bamo[1];
var _amo = _row * _col;
var _irow = 1 / _row;
var _icol = 1 / _col;
var _grw = _sw * _icol;
var _grh = _sh * _irow;
var _rad = min(_grw, _grh) / 2;
var _light = [ lengthdir_x(1, _ldir), lengthdir_y(1, _ldir), 1 ];
var _cx = _sw / 2;
var _cy = _sh / 2;
var _cd = sqrt(_cx * _cx + _cy * _cy);
_strh_shf *= _cd;
var _strh_dx = lengthdir_x(1, _strh_dir);
var _strh_dy = lengthdir_y(1, _strh_dir);
var _twst_dx = lengthdir_x(1, _twst_axs - 90);
var _twst_dy = lengthdir_y(1, _twst_axs - 90);
var _rnd_rad = _rad * _rond * 2;
surface_set_shader(_outSurf, sh_mk_ballGrid);
shader_set_surface("texture", _surf);
shader_set_f("lightPos", _light);
shader_set_f("lightInt", _shad);
shader_set_f("dimension", _dim);
for( var i = 0; i < _amo; i++ ) {
var _c = i % _col;
var _r = floor(i * _icol);
var _smpw = _c * _icol;
var _smph = _r * _irow;
var _bx = (_c + 0.5) * _grw - 1;
var _by = (_r + 0.5) * _grh - 1;
var bx = _posi[0] + _bx;
var by = _posi[1] + _by;
var _cdist = point_distance(_cx, _cy, _bx, _by);
if(_twst != 0) { #region
var _cdirr = _twst_axs - point_direction(_cx, _cy, _bx, _by);
var _st_prg = _cdist * dsin(_cdirr);
var _ax_prg = _cdist * (dcos(_cdirr));
var _tw_prg = 90 + _ax_prg * _twst + _twst_shf * 360;
bx = (_bx - _twst_dx * _st_prg) + _twst_dx * _st_prg * dsin(_tw_prg);
by = (_by - _twst_dy * _st_prg) + _twst_dy * _st_prg * dsin(_tw_prg);
} #endregion
if(_strh != 0) { #region
var _cdirr = _strh_dir + 90 - point_direction(_cx, _cy, _bx, _by);
var _st_prg = _cdist * dsin(_cdirr) + _strh_shf;
var _st_str = max(0, _st_prg * _strh);
bx += _strh_dx * _st_str;
by += _strh_dy * _st_str;
} #endregion
if(_scat != 0) { #region
var _dir = random_range(0, 360) + _rota;
var _dis = random_range(0.1, 1);
bx += lengthdir_x(_dis, _dir) * _scat;
by += lengthdir_y(_dis, _dir) * _scat;
} #endregion
var _br = _rad;
shader_set_f("ballPos", bx + 1, by + 1);
shader_set_f("ballRad", _br);
shader_set_f("ballShift", 0, 0, 0);
shader_set_f("samplePos", _smpw, _smph);
if(_rond == 1) draw_circle(bx, by, _br, false);
else draw_roundrect_ext(bx - _br, by - _br, bx + _br, by + _br, _rnd_rad, _rnd_rad, false);
}
surface_reset_shader();
return _outSurf;
}
}

View file

@ -1,7 +1,7 @@
{
"resourceType": "GMScript",
"resourceVersion": "1.0",
"name": "node_mk_balls",
"name": "node_mk_grid_balls",
"isCompatibility": false,
"isDnD": false,
"parent": {

View file

@ -26,30 +26,31 @@ function Node_MK_Rain(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
inputs[| 8] = nodeValue("Seed", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, irandom_range(100_000, 999_999));
inputs[| 9] = nodeValue("Shape", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Rain", "Snow" ]);
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Rain", "Snow", "Texture" ]);
inputs[| 10] = nodeValue("Snow size", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 3, 4 ])
.setDisplay(VALUE_DISPLAY.vector_range);
inputs[| 11] = nodeValue("Texture", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone);
input_display_list = [ 0, 8,
["Shape", false], 9, 3, 4, 10,
["Effect", false], 1, 2, 7,
["Shape", false], 9, 3, 4, 10, 11,
["Effect", false], 2, 1, 7,
["Render", false], 5, 6,
];
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
drops = [];
static step = function() {
static step = function() { #region
var _shap = getSingleValue(9);
inputs[| 3].setVisible(_shap == 0);
inputs[| 4].setVisible(_shap == 0);
inputs[| 10].setVisible(_shap == 1);
}
inputs[| 11].setVisible(_shap == 2);
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) {
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
var _surf = _data[0];
var _dirr = _data[1];
var _dens = _data[2];
@ -61,12 +62,17 @@ function Node_MK_Rain(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
var _seed = _data[8];
var _shap = _data[9];
var _snws = _data[10];
var _text = _data[11];
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);
var _tw = surface_get_width_safe(_text);
var _th = surface_get_height_safe(_text);
var _rad = sqrt(_sw * _sw + _sh * _sh) / 2;
var _rx = _sw / 2;
var _ry = _sh / 2;
@ -74,21 +80,27 @@ function Node_MK_Rain(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
var _tr_span_x = lengthdir_x(1, _dirr);
var _tr_span_y = lengthdir_y(1, _dirr);
var _in_span_x = lengthdir_x(1, _dirr + 90);
var _in_span_y = lengthdir_y(1, _dirr + 90);
var prg = CURRENT_FRAME / TOTAL_FRAMES;
var _1c = array_length(_colr.keys) == 1;
var _cc = _1c? _colr.eval(0) : _colr;
draw_set_circle_precision(32);
surface_set_target(_outSurf);
DRAW_CLEAR
draw_surface(_surf, 0, 0);
if(_1c) draw_set_color(_cc);
BLEND_ALPHA_MULP
for( var i = 0; i < _dens; i++ ) {
repeat(_dens) {
var _r_shf = random_range(-_rad, _rad);
var _y_shf = random(1);
var _rmx = _rx + lengthdir_x(_r_shf, _dirr + 90);
var _rmy = _ry + lengthdir_y(_r_shf, _dirr + 90);
var _drpW, _drpH;
var _drpW, _drpH, _drpS;
switch(_shap) {
case 0 :
_drpW = irandom_range(_rwid[0], _rwid[1]);
@ -98,34 +110,46 @@ function Node_MK_Rain(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
_drpW = random_range(_snws[0], _snws[1]);
_drpH = _drpW;
break;
case 2 :
_drpW = _tw;
_drpH = _th;
break;
}
var _t0x = _rmx + (_tr_span_x * (_rad + _drpH));
var _t0y = _rmy + (_tr_span_y * (_rad + _drpH));
var _rmx = _rx + _in_span_x * _r_shf;
var _rmy = _ry + _in_span_y * _r_shf;
var _radH = _rad + _drpH;
var _radHx = _radH * _tr_span_x;
var _radHy = _radH * _tr_span_y;
var _vel = irandom_range(_velo[0], _velo[1]);
var _prg = _y_shf + _vel * (CURRENT_FRAME / TOTAL_FRAMES);
_prg = frac(_prg);
var _drpX = _t0x - _prg * _tr_span_x * ((_rad + _drpH) * 2);
var _drpY = _t0y - _prg * _tr_span_y * ((_rad + _drpH) * 2);
var _prg = _y_shf + _vel * prg;
_prg = frac(_prg) - 0.5;
draw_set_color(_colr.eval(random(1)));
var _drpX = _rmx - _prg * _radHx * 2;
var _drpY = _rmy - _prg * _radHy * 2;
if(!_1c) draw_set_color(_colr.eval(random(1)));
draw_set_alpha(random_range(_alph[0], _alph[1]));
switch(_shap) {
case 0 :
var _tr_span_w = _tr_span_x * _drpH;
var _tr_span_h = _tr_span_y * _drpH;
draw_line_width(
_drpX - _tr_span_x * _drpH,
_drpY - _tr_span_y * _drpH,
_drpX + _tr_span_x * _drpH,
_drpY + _tr_span_y * _drpH,
_drpX - _tr_span_w, _drpY - _tr_span_h,
_drpX + _tr_span_w, _drpY + _tr_span_h,
_drpW
);
break;
case 1 :
draw_circle(_drpX, _drpY, _drpW, false);
break;
case 2 :
draw_surface_ext(_text, _drpX, _drpY, 1, 1, 0, draw_get_color(), draw_get_alpha());
break;
}
}
@ -134,5 +158,5 @@ function Node_MK_Rain(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
surface_reset_target();
return _outSurf;
}
} #endregion
}

View file

@ -81,8 +81,10 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor { #regio
static drawGrid = function(_x, _y, _mx, _my, grid_size) { #region
var spr_x = _x + grid_size / 2;
var spr_y = _y + grid_size / 2;
gpu_set_tex_filter(true);
draw_sprite_ui_uniform(spr, 0, spr_x, spr_y, 0.5);
gpu_set_tex_filter(false);
if(new_node) {
draw_sprite_ui_uniform(THEME.node_new_badge, 0, _x + grid_size - ui(12), _y + ui(6),, COLORS._main_accent);
@ -121,8 +123,10 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor { #regio
var spr_y = _y + list_height / 2;
var ss = (list_height - ui(8)) / max(sprite_get_width(spr), sprite_get_height(spr));
gpu_set_tex_filter(true);
draw_sprite_ext(spr, 0, spr_x, spr_y, ss, ss, 0, c_white, 1);
gpu_set_tex_filter(false);
var tx = list_height + ui(52);
if(new_node) {
@ -611,6 +615,7 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor { #regio
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 GridBalls", s_node_mk_ball_grid, "Node_MK_GridBalls", [1, Node_MK_GridBalls]).setVersion(11600);
#endregion
var compose = ds_list_create(); #region

View file

@ -5,6 +5,7 @@
PREFERENCES.ui_framerate = 120;
PREFERENCES.path_resolution = 32;
PREFERENCES.move_directory = false;
PREFERENCES.node_recents_amount = 20;
@ -202,6 +203,8 @@
LOCALE_DEF = PREFERENCES.local == "en";
directory_verify(filepath_resolve(PREFERENCES.temp_path));
if(PREFERENCES.move_directory) directory_set_current_working(DIRECTORY);
}
function PREF_APPLY() {

View file

@ -87,10 +87,10 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor {
_input_text = _current_text;
_last_text = _current_text;
cursor = string_length(_current_text);
cursor_select = 0;
cursor = string_length(_current_text);
click_block = 1;
click_block = 1;
KEYBOARD_STRING = "";
keyboard_lastkey = -1;
} #endregion
@ -110,8 +110,8 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor {
cursor_select = cursor;
} else if(cursor_select != -1)
cursor_select = -1;
else
move_cursor(-1);
move_cursor(-1);
}
if(KEYBOARD_PRESSED == vk_right) {
@ -120,8 +120,8 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor {
cursor_select = cursor;
} else if(cursor_select != -1)
cursor_select = -1;
else
move_cursor(1);
move_cursor(1);
}
} #endregion
@ -445,9 +445,11 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor {
if(cursor_select > -1) { //draw highlight
draw_set_color(COLORS.widget_text_highlight);
var x1 = tx + string_width(string_copy(txt, 1, cursor_select));
var c_x1 = tx + disp_x + string_width(string_copy(txt, 1, cursor_select));
var _rx0 = clamp(min(cursor_pos, c_x1), tx, tx + _w);
var _rx1 = clamp(max(cursor_pos, c_x1), tx, tx + _w);
draw_roundrect_ext(cursor_pos, c_y0, x1, c_y1, THEME_VALUE.highlight_corner_radius, THEME_VALUE.highlight_corner_radius, 0);
draw_roundrect_ext(_rx0, c_y0, _rx1, c_y1, THEME_VALUE.highlight_corner_radius, THEME_VALUE.highlight_corner_radius, 0);
}
var _mx = -1;

View file

@ -0,0 +1,32 @@
varying vec4 v_vColour;
varying vec2 v_vPosition;
uniform sampler2D texture;
uniform vec2 dimension;
uniform vec2 samplePos;
uniform vec3 lightPos;
uniform float lightInt;
void main() {
vec4 col = texture2D( texture, samplePos );
vec2 tx = 1. / dimension;
float x = v_vPosition.x - tx.x;
float y = v_vPosition.y - tx.y;
float mag = sqrt(x * x + y * y);
if(mag >= 1.) {
x /= (mag + tx.x);
y /= (mag + tx.y);
}
float z = sqrt(1.0 - (pow(x, 2.0) + pow(y, 2.0)));
vec3 position = vec3(x, y, z);
vec3 normal = normalize(position);
vec3 light = normalize(lightPos);
float lightInf = 1. - dot(normal, light);
col.rgb -= col.rgb * lightInf * lightInt;
gl_FragColor = col;
}

View file

@ -0,0 +1,18 @@
attribute vec3 in_Position; // (x,y,z)
attribute vec4 in_Colour; // (r,g,b,a)
varying vec4 v_vColour;
varying vec2 v_vPosition;
uniform vec2 ballPos;
uniform float ballRad;
uniform vec3 ballShift;
void main() {
vec3 ballPosition = in_Position + ballShift;
vec4 object_space_pos = vec4( ballPosition, 1.0);
gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * object_space_pos;
v_vColour = in_Colour;
v_vPosition = (in_Position.xy - ballPos) / ballRad;
}

View file

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View file

@ -0,0 +1,74 @@
{
"resourceType": "GMSprite",
"resourceVersion": "1.0",
"name": "s_node_mk_ball_grid",
"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":"93617f8b-5294-4379-9291-8997c8659aaf",},
],
"gridX": 0,
"gridY": 0,
"height": 64,
"HTile": false,
"layers": [
{"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"cc424554-c7d8-4d22-ad63-84b7e506e945","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_ball_grid",
"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":"93617f8b-5294-4379-9291-8997c8659aaf","path":"sprites/s_node_mk_ball_grid/s_node_mk_ball_grid.yy",},},},"Disabled":false,"id":"f59f5080-75ed-44e8-9afe-39cd8e92ad39","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,
}