[Graph, preview panel] Zoom level can now be edit directly.
@ -886,6 +886,7 @@
|
|||||||
{"name":"node_group_thumbnail","order":3,"path":"scripts/node_group_thumbnail/node_group_thumbnail.yy",},
|
{"name":"node_group_thumbnail","order":3,"path":"scripts/node_group_thumbnail/node_group_thumbnail.yy",},
|
||||||
{"name":"node_guide","order":8,"path":"scripts/node_guide/node_guide.yy",},
|
{"name":"node_guide","order":8,"path":"scripts/node_guide/node_guide.yy",},
|
||||||
{"name":"node_herringbone_tile","order":7,"path":"scripts/node_herringbone_tile/node_herringbone_tile.yy",},
|
{"name":"node_herringbone_tile","order":7,"path":"scripts/node_herringbone_tile/node_herringbone_tile.yy",},
|
||||||
|
{"name":"node_high_pass","order":14,"path":"scripts/node_high_pass/node_high_pass.yy",},
|
||||||
{"name":"node_hlsl","order":11,"path":"scripts/node_hlsl/node_hlsl.yy",},
|
{"name":"node_hlsl","order":11,"path":"scripts/node_hlsl/node_hlsl.yy",},
|
||||||
{"name":"node_honey_noise","order":20,"path":"scripts/node_honey_noise/node_honey_noise.yy",},
|
{"name":"node_honey_noise","order":20,"path":"scripts/node_honey_noise/node_honey_noise.yy",},
|
||||||
{"name":"node_hsv_channel","order":1,"path":"scripts/node_hsv_channel/node_hsv_channel.yy",},
|
{"name":"node_hsv_channel","order":1,"path":"scripts/node_hsv_channel/node_hsv_channel.yy",},
|
||||||
@ -1589,6 +1590,7 @@
|
|||||||
{"name":"sh_grid_pentagonal","order":7,"path":"shaders/sh_grid_pentagonal/sh_grid_pentagonal.yy",},
|
{"name":"sh_grid_pentagonal","order":7,"path":"shaders/sh_grid_pentagonal/sh_grid_pentagonal.yy",},
|
||||||
{"name":"sh_grid_tri","order":3,"path":"shaders/sh_grid_tri/sh_grid_tri.yy",},
|
{"name":"sh_grid_tri","order":3,"path":"shaders/sh_grid_tri/sh_grid_tri.yy",},
|
||||||
{"name":"sh_herringbone_tile","order":5,"path":"shaders/sh_herringbone_tile/sh_herringbone_tile.yy",},
|
{"name":"sh_herringbone_tile","order":5,"path":"shaders/sh_herringbone_tile/sh_herringbone_tile.yy",},
|
||||||
|
{"name":"sh_high_pass","order":15,"path":"shaders/sh_high_pass/sh_high_pass.yy",},
|
||||||
{"name":"sh_image_trace","order":34,"path":"shaders/sh_image_trace/sh_image_trace.yy",},
|
{"name":"sh_image_trace","order":34,"path":"shaders/sh_image_trace/sh_image_trace.yy",},
|
||||||
{"name":"sh_interlaced","order":58,"path":"shaders/sh_interlaced/sh_interlaced.yy",},
|
{"name":"sh_interlaced","order":58,"path":"shaders/sh_interlaced/sh_interlaced.yy",},
|
||||||
{"name":"sh_invert","order":17,"path":"shaders/sh_invert/sh_invert.yy",},
|
{"name":"sh_invert","order":17,"path":"shaders/sh_invert/sh_invert.yy",},
|
||||||
@ -2235,6 +2237,7 @@
|
|||||||
{"name":"s_node_gui_in","order":37,"path":"sprites/s_node_gui_in/s_node_gui_in.yy",},
|
{"name":"s_node_gui_in","order":37,"path":"sprites/s_node_gui_in/s_node_gui_in.yy",},
|
||||||
{"name":"s_node_gui_out","order":36,"path":"sprites/s_node_gui_out/s_node_gui_out.yy",},
|
{"name":"s_node_gui_out","order":36,"path":"sprites/s_node_gui_out/s_node_gui_out.yy",},
|
||||||
{"name":"s_node_herringbone_tile","order":39,"path":"sprites/s_node_herringbone_tile/s_node_herringbone_tile.yy",},
|
{"name":"s_node_herringbone_tile","order":39,"path":"sprites/s_node_herringbone_tile/s_node_herringbone_tile.yy",},
|
||||||
|
{"name":"s_node_high_pass","order":10,"path":"sprites/s_node_high_pass/s_node_high_pass.yy",},
|
||||||
{"name":"s_node_hlsl","order":32,"path":"sprites/s_node_hlsl/s_node_hlsl.yy",},
|
{"name":"s_node_hlsl","order":32,"path":"sprites/s_node_hlsl/s_node_hlsl.yy",},
|
||||||
{"name":"s_node_honey","order":66,"path":"sprites/s_node_honey/s_node_honey.yy",},
|
{"name":"s_node_honey","order":66,"path":"sprites/s_node_honey/s_node_honey.yy",},
|
||||||
{"name":"s_node_HSV_combine","order":28,"path":"sprites/s_node_HSV_combine/s_node_HSV_combine.yy",},
|
{"name":"s_node_HSV_combine","order":28,"path":"sprites/s_node_HSV_combine/s_node_HSV_combine.yy",},
|
||||||
|
@ -1454,6 +1454,7 @@
|
|||||||
{"id":{"name":"node_group","path":"scripts/node_group/node_group.yy",},},
|
{"id":{"name":"node_group","path":"scripts/node_group/node_group.yy",},},
|
||||||
{"id":{"name":"node_guide","path":"scripts/node_guide/node_guide.yy",},},
|
{"id":{"name":"node_guide","path":"scripts/node_guide/node_guide.yy",},},
|
||||||
{"id":{"name":"node_herringbone_tile","path":"scripts/node_herringbone_tile/node_herringbone_tile.yy",},},
|
{"id":{"name":"node_herringbone_tile","path":"scripts/node_herringbone_tile/node_herringbone_tile.yy",},},
|
||||||
|
{"id":{"name":"node_high_pass","path":"scripts/node_high_pass/node_high_pass.yy",},},
|
||||||
{"id":{"name":"node_hlsl","path":"scripts/node_hlsl/node_hlsl.yy",},},
|
{"id":{"name":"node_hlsl","path":"scripts/node_hlsl/node_hlsl.yy",},},
|
||||||
{"id":{"name":"node_honey_noise","path":"scripts/node_honey_noise/node_honey_noise.yy",},},
|
{"id":{"name":"node_honey_noise","path":"scripts/node_honey_noise/node_honey_noise.yy",},},
|
||||||
{"id":{"name":"node_hsv_channel","path":"scripts/node_hsv_channel/node_hsv_channel.yy",},},
|
{"id":{"name":"node_hsv_channel","path":"scripts/node_hsv_channel/node_hsv_channel.yy",},},
|
||||||
@ -2259,6 +2260,7 @@
|
|||||||
{"id":{"name":"sh_grid_tri","path":"shaders/sh_grid_tri/sh_grid_tri.yy",},},
|
{"id":{"name":"sh_grid_tri","path":"shaders/sh_grid_tri/sh_grid_tri.yy",},},
|
||||||
{"id":{"name":"sh_grid","path":"shaders/sh_grid/sh_grid.yy",},},
|
{"id":{"name":"sh_grid","path":"shaders/sh_grid/sh_grid.yy",},},
|
||||||
{"id":{"name":"sh_herringbone_tile","path":"shaders/sh_herringbone_tile/sh_herringbone_tile.yy",},},
|
{"id":{"name":"sh_herringbone_tile","path":"shaders/sh_herringbone_tile/sh_herringbone_tile.yy",},},
|
||||||
|
{"id":{"name":"sh_high_pass","path":"shaders/sh_high_pass/sh_high_pass.yy",},},
|
||||||
{"id":{"name":"sh_image_trace","path":"shaders/sh_image_trace/sh_image_trace.yy",},},
|
{"id":{"name":"sh_image_trace","path":"shaders/sh_image_trace/sh_image_trace.yy",},},
|
||||||
{"id":{"name":"sh_interlaced","path":"shaders/sh_interlaced/sh_interlaced.yy",},},
|
{"id":{"name":"sh_interlaced","path":"shaders/sh_interlaced/sh_interlaced.yy",},},
|
||||||
{"id":{"name":"sh_interpret_number","path":"shaders/sh_interpret_number/sh_interpret_number.yy",},},
|
{"id":{"name":"sh_interpret_number","path":"shaders/sh_interpret_number/sh_interpret_number.yy",},},
|
||||||
@ -2969,6 +2971,7 @@
|
|||||||
{"id":{"name":"s_node_gui_in","path":"sprites/s_node_gui_in/s_node_gui_in.yy",},},
|
{"id":{"name":"s_node_gui_in","path":"sprites/s_node_gui_in/s_node_gui_in.yy",},},
|
||||||
{"id":{"name":"s_node_gui_out","path":"sprites/s_node_gui_out/s_node_gui_out.yy",},},
|
{"id":{"name":"s_node_gui_out","path":"sprites/s_node_gui_out/s_node_gui_out.yy",},},
|
||||||
{"id":{"name":"s_node_herringbone_tile","path":"sprites/s_node_herringbone_tile/s_node_herringbone_tile.yy",},},
|
{"id":{"name":"s_node_herringbone_tile","path":"sprites/s_node_herringbone_tile/s_node_herringbone_tile.yy",},},
|
||||||
|
{"id":{"name":"s_node_high_pass","path":"sprites/s_node_high_pass/s_node_high_pass.yy",},},
|
||||||
{"id":{"name":"s_node_hlsl","path":"sprites/s_node_hlsl/s_node_hlsl.yy",},},
|
{"id":{"name":"s_node_hlsl","path":"sprites/s_node_hlsl/s_node_hlsl.yy",},},
|
||||||
{"id":{"name":"s_node_honey","path":"sprites/s_node_honey/s_node_honey.yy",},},
|
{"id":{"name":"s_node_honey","path":"sprites/s_node_honey/s_node_honey.yy",},},
|
||||||
{"id":{"name":"s_node_HSV_combine","path":"sprites/s_node_HSV_combine/s_node_HSV_combine.yy",},},
|
{"id":{"name":"s_node_HSV_combine","path":"sprites/s_node_HSV_combine/s_node_HSV_combine.yy",},},
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
LATEST_VERSION = 1_18_00_0;
|
LATEST_VERSION = 1_18_00_0;
|
||||||
VERSION = 1_18_01_0;
|
VERSION = 1_18_01_0;
|
||||||
SAVE_VERSION = 1_18_01_0;
|
SAVE_VERSION = 1_18_01_0;
|
||||||
VERSION_STRING = MAC? "1.18.003m" : "1.18.2.002";
|
VERSION_STRING = MAC? "1.18.003m" : "1.18.2.003";
|
||||||
BUILD_NUMBER = 1_18_01_0;
|
BUILD_NUMBER = 1_18_01_0;
|
||||||
|
|
||||||
HOTKEYS = ds_map_create();
|
HOTKEYS = ds_map_create();
|
||||||
|
@ -192,7 +192,7 @@ function Node_Color_adjust(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||||||
s = clamp(s * (_sat + 1), 0, 1);
|
s = clamp(s * (_sat + 1), 0, 1);
|
||||||
|
|
||||||
_c = make_color_hsva(h * 255, s * 255, v * 255, a);
|
_c = make_color_hsva(h * 255, s * 255, v * 255, a);
|
||||||
_c = merge_color_a(_c, _bl, _bla);
|
_c = merge_color(_c, _bl, _bla);
|
||||||
_col[i] = _c;
|
_col[i] = _c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,16 +44,15 @@ function Node_Convolution(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
|||||||
var _ker = _data[1];
|
var _ker = _data[1];
|
||||||
var _nrm = _data[9];
|
var _nrm = _data[9];
|
||||||
var _siz = max(3, _data[10]);
|
var _siz = max(3, _data[10]);
|
||||||
var _sam = struct_try_get(attributes, "oversample");
|
|
||||||
|
|
||||||
inputs[1].editWidget.setSize(_siz);
|
inputs[1].editWidget.setSize(_siz);
|
||||||
_ker = array_verify(_ker, _siz * _siz);
|
_ker = array_verify(_ker, _siz * _siz);
|
||||||
|
|
||||||
surface_set_shader(_outSurf, sh_convolution, true, BLEND.over);
|
surface_set_shader(_outSurf, sh_convolution, true, BLEND.over);
|
||||||
|
shader_set_i("sampleMode", attributes.oversample);
|
||||||
shader_set_dim("dimension", _outSurf);
|
shader_set_dim("dimension", _outSurf);
|
||||||
shader_set_f("kernel", _ker);
|
shader_set_f("kernel", _ker);
|
||||||
shader_set_i("size", _siz);
|
shader_set_i("size", _siz);
|
||||||
shader_set_i("sampleMode", _sam);
|
|
||||||
shader_set_i("normalized", _nrm);
|
shader_set_i("normalized", _nrm);
|
||||||
|
|
||||||
draw_surface_safe(_data[0]);
|
draw_surface_safe(_data[0]);
|
||||||
|
@ -1352,8 +1352,8 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||||||
static drawNodeOverlay = function(xx, yy, _mx, _my, _s) {}
|
static drawNodeOverlay = function(xx, yy, _mx, _my, _s) {}
|
||||||
|
|
||||||
__draw_bbox = BBOX();
|
__draw_bbox = BBOX();
|
||||||
static drawGetBbox = function(xx, yy, _s) {
|
static drawGetBbox = function(xx, yy, _s, label = true) {
|
||||||
var pad_label = draw_name && display_parameter.avoid_label;
|
var pad_label = (display_parameter.avoid_label || label) && draw_name;
|
||||||
|
|
||||||
var x0 = xx;
|
var x0 = xx;
|
||||||
var x1 = xx + w * _s;
|
var x1 = xx + w * _s;
|
||||||
@ -1394,8 +1394,10 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||||||
var aa = (.25 + .5 * renderActive) * (.25 + .75 * isHighlightingInGraph());
|
var aa = (.25 + .5 * renderActive) * (.25 + .75 * isHighlightingInGraph());
|
||||||
var cc = getColor();
|
var cc = getColor();
|
||||||
var nh = previewable? name_height * _s : h * _s;
|
var nh = previewable? name_height * _s : h * _s;
|
||||||
|
var ba = aa;
|
||||||
|
|
||||||
draw_sprite_stretched_ext(THEME.node_bg, 2, xx, yy, w * _s, nh, cc, aa);
|
if(_panel && _panel.node_hovering == self) ba = .1;
|
||||||
|
draw_sprite_stretched_ext(THEME.node_bg, 2, xx, yy, w * _s, nh, cc, ba);
|
||||||
|
|
||||||
var cc = COLORS._main_text;
|
var cc = COLORS._main_text;
|
||||||
if(PREFERENCES.node_show_render_status && !rendered)
|
if(PREFERENCES.node_show_render_status && !rendered)
|
||||||
@ -1428,7 +1430,10 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||||||
draw_set_text(f_sdf, fa_left, fa_center, cc, aa);
|
draw_set_text(f_sdf, fa_left, fa_center, cc, aa);
|
||||||
var _txt = string_cut(_name, tw, "...", _ts);
|
var _txt = string_cut(_name, tw, "...", _ts);
|
||||||
BLEND_ALPHA_MULP
|
BLEND_ALPHA_MULP
|
||||||
draw_text_transformed(_tx, _ty, _txt, _ts, _ts, 0);
|
|
||||||
|
draw_set_color(0); draw_set_alpha(1); draw_text_transformed(_tx + 1, _ty + 1, _txt, _ts, _ts, 0);
|
||||||
|
draw_set_color(cc); draw_set_alpha(1); draw_text_transformed(_tx, _ty, _txt, _ts, _ts, 0);
|
||||||
|
|
||||||
BLEND_NORMAL
|
BLEND_NORMAL
|
||||||
draw_set_alpha(1);
|
draw_set_alpha(1);
|
||||||
|
|
||||||
@ -1789,7 +1794,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||||||
__preview_sw = surface_get_width_safe(preview_surface);
|
__preview_sw = surface_get_width_safe(preview_surface);
|
||||||
__preview_sh = surface_get_height_safe(preview_surface);
|
__preview_sh = surface_get_height_safe(preview_surface);
|
||||||
|
|
||||||
var bbox = drawGetBbox(xx, yy, _s);
|
var bbox = drawGetBbox(xx, yy, _s, false);
|
||||||
var aa = 0.5 + 0.5 * renderActive;
|
var aa = 0.5 + 0.5 * renderActive;
|
||||||
if(!isHighlightingInGraph()) aa *= 0.25;
|
if(!isHighlightingInGraph()) aa *= 0.25;
|
||||||
|
|
||||||
|
@ -19,9 +19,9 @@ function Node_Grid_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||||||
var i = index - input_fix_len;
|
var i = index - input_fix_len;
|
||||||
|
|
||||||
newInput(index, nodeValue_Vec2($"Anchor {i}", self, [ 0, 0 ]))
|
newInput(index, nodeValue_Vec2($"Anchor {i}", self, [ 0, 0 ]))
|
||||||
.setUnitRef(function(index) /*=>*/ {return getDimension(index)});
|
.setUnitRef(function(index) /*=>*/ {return getDimension(index)}, VALUE_UNIT.reference);
|
||||||
|
|
||||||
array_push(input_display_list, index);
|
inputs[index].overlay_draw_text = false;
|
||||||
return inputs[index];
|
return inputs[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,37 +35,129 @@ function Node_Grid_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||||||
attribute_surface_depth();
|
attribute_surface_depth();
|
||||||
attribute_interpolation();
|
attribute_interpolation();
|
||||||
|
|
||||||
static resetDisplay = function() {
|
static resetInput = function() {
|
||||||
input_display_list = array_clone(input_display_list_raw, 1);
|
input_display_list = array_clone(input_display_list_raw, 1);
|
||||||
for( var i = input_display_len, n = array_length(inputs); i < n; i++ )
|
array_resize(inputs, input_fix_len);
|
||||||
array_push(input_display_list, i);
|
|
||||||
|
var _grid = getInputData(2);
|
||||||
|
var _st = _grid? 1 / _grid : 1;
|
||||||
|
var _ind = input_fix_len;
|
||||||
|
var _dim = getDimension(0);
|
||||||
|
|
||||||
|
for(var i = 0; i <= _grid; i++)
|
||||||
|
for(var j = 0; j <= _grid; j++) {
|
||||||
|
array_push(input_display_list, _ind++);
|
||||||
|
|
||||||
|
var _inp = createNewInput();
|
||||||
|
_inp.setValueInspector([ j * _st * _dim[0], i * _st * _dim[1] ]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||||
var mx = (_mx - _x) / _s;
|
var mx = (_mx - _x) / _s;
|
||||||
var my = (_my - _y) / _s;
|
var my = (_my - _y) / _s;
|
||||||
|
|
||||||
|
var _surf = getInputData(0);
|
||||||
|
var _grid = getInputData(2);
|
||||||
|
|
||||||
|
var _aamo = (_grid + 1) * (_grid + 1);
|
||||||
|
var _iamo = getInputAmount();
|
||||||
|
|
||||||
|
if(_iamo != _aamo) return;
|
||||||
|
var _hov = false;
|
||||||
|
|
||||||
|
var _an = array_create(_iamo);
|
||||||
|
|
||||||
|
for( var i = input_fix_len, n = array_length(inputs); i < n; i++ ) {
|
||||||
|
var _i = i - input_fix_len;
|
||||||
|
|
||||||
|
_an[_i] = inputs[i].getValue();
|
||||||
|
_an[_i][0] = _x + _an[_i][0] * _s;
|
||||||
|
_an[_i][1] = _y + _an[_i][1] * _s;
|
||||||
|
}
|
||||||
|
|
||||||
|
draw_set_color(COLORS._main_accent);
|
||||||
|
for( var i = 0; i < _grid; i++ )
|
||||||
|
for( var j = 0; j <= _grid; j++ ) {
|
||||||
|
var _a0 = _an[(i ) * (_grid + 1) + j];
|
||||||
|
var _a1 = _an[(i + 1) * (_grid + 1) + j];
|
||||||
|
|
||||||
|
draw_line(_a0[0], _a0[1], _a1[0], _a1[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
for( var i = 0; i <= _grid; i++ )
|
||||||
|
for( var j = 0; j < _grid; j++ ) {
|
||||||
|
var _a0 = _an[i * (_grid + 1) + (j )];
|
||||||
|
var _a1 = _an[i * (_grid + 1) + (j + 1)];
|
||||||
|
|
||||||
|
draw_line(_a0[0], _a0[1], _a1[0], _a1[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
for( var i = input_fix_len, n = array_length(inputs); i < n; i++ ) {
|
||||||
|
var hv = inputs[i].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); active &= !hv; _hov |= hv;
|
||||||
|
}
|
||||||
|
|
||||||
|
return _hov;
|
||||||
}
|
}
|
||||||
|
|
||||||
static step = function() {
|
static step = function() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static preGetInputs = function() {
|
||||||
|
var _grid = inputs[2].getValue();
|
||||||
|
|
||||||
|
var _aamo = (_grid + 1) * (_grid + 1);
|
||||||
|
var _iamo = getInputAmount();
|
||||||
|
if(_iamo != _aamo) resetInput();
|
||||||
|
}
|
||||||
|
|
||||||
|
static draw_vertex_rectangle = function(_x0, _y0, _x1, _y1, _x2, _y2, _x3, _y3, _u0, _v0, _u1, _v1) {
|
||||||
|
draw_vertex_texture(_x0, _y0, _u0, _v0);
|
||||||
|
draw_vertex_texture(_x1, _y1, _u1, _v0);
|
||||||
|
draw_vertex_texture(_x2, _y2, _u0, _v1);
|
||||||
|
|
||||||
|
draw_vertex_texture(_x1, _y1, _u1, _v0);
|
||||||
|
draw_vertex_texture(_x2, _y2, _u0, _v1);
|
||||||
|
draw_vertex_texture(_x3, _y3, _u1, _v1);
|
||||||
|
}
|
||||||
|
|
||||||
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
||||||
var _surf = _data[0];
|
var _surf = _data[0];
|
||||||
var _grid = _data[2];
|
var _grid = _data[2];
|
||||||
|
|
||||||
var _aamo = (_grid + 1) * (_grid + 1);
|
if(!is_surface(_surf)) return _outSurf;
|
||||||
var _iamo = getInputAmount();
|
|
||||||
|
|
||||||
if(_iamo < _aamo) {
|
var _dim = surface_get_dimension(_surf);
|
||||||
repeat(_aamo - _iamo) createNewInput();
|
var _st = _grid? 1 / _grid : 1;
|
||||||
resetDisplay();
|
var _smp = 2;
|
||||||
|
|
||||||
} else if(_iamo > _aamo) {
|
|
||||||
array_resize(inputs, input_fix_len + _aamo);
|
|
||||||
resetDisplay();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
surface_set_target(_outSurf);
|
||||||
|
DRAW_CLEAR
|
||||||
|
BLEND_OVERRIDE
|
||||||
|
|
||||||
|
draw_set_color(c_white);
|
||||||
|
draw_set_alpha(1);
|
||||||
|
|
||||||
|
draw_primitive_begin_texture(pr_trianglelist, surface_get_texture(_surf));
|
||||||
|
for( var i = 0; i < _grid; i++ )
|
||||||
|
for( var j = 0; j < _grid; j++ ) {
|
||||||
|
var _a0 = _data[input_fix_len + (i ) * (_grid + 1) + (j )];
|
||||||
|
var _a1 = _data[input_fix_len + (i ) * (_grid + 1) + (j + 1)];
|
||||||
|
var _a2 = _data[input_fix_len + (i + 1) * (_grid + 1) + (j )];
|
||||||
|
var _a3 = _data[input_fix_len + (i + 1) * (_grid + 1) + (j + 1)];
|
||||||
|
|
||||||
|
var _u0 = _st * (j );
|
||||||
|
var _u1 = _st * (j + 1);
|
||||||
|
var _v0 = _st * (i );
|
||||||
|
var _v1 = _st * (i + 1);
|
||||||
|
|
||||||
|
draw_vertex_rectangle(_a0[0], _a0[1], _a1[0], _a1[1], _a2[0], _a2[1], _a3[0], _a3[1], _u0, _v0, _u1, _v1);
|
||||||
|
}
|
||||||
|
draw_primitive_end();
|
||||||
|
BLEND_NORMAL
|
||||||
|
surface_reset_target();
|
||||||
|
|
||||||
|
return _outSurf;
|
||||||
}
|
}
|
||||||
}
|
}
|
37
scripts/node_high_pass/node_bw.gml
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
function Node_create_BW(_x, _y) {
|
||||||
|
var node = new Node_BW(_x, _y);
|
||||||
|
ds_list_add(PANEL_GRAPH.nodes_list, node);
|
||||||
|
return node;
|
||||||
|
}
|
||||||
|
|
||||||
|
function Node_BW(_x, _y) : Node_Processor(_x, _y) constructor {
|
||||||
|
name = "BW";
|
||||||
|
|
||||||
|
uniform_exp = shader_get_uniform(sh_bw, "brightness");
|
||||||
|
uniform_con = shader_get_uniform(sh_bw, "contrast");
|
||||||
|
|
||||||
|
newInput(| 0, NodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0));
|
||||||
|
newInput(| 1, NodeValue_Float(1, "Brightness", self, 0));
|
||||||
|
inputs[| 1].setDisplay(VALUE_DISPLAY.slider, [ -1, 1, 0.01]);
|
||||||
|
|
||||||
|
newInput(| 2, NodeValue_Float(2, "Contrast", self, 1));
|
||||||
|
inputs[| 2].setDisplay(VALUE_DISPLAY.slider, [ -1, 4, 0.01]);
|
||||||
|
|
||||||
|
outputs[| 0] = new nodeValue_Output(0, "Surface out", self, VALUE_TYPE.surface, surface_create(1, 1));
|
||||||
|
|
||||||
|
function process_data(_inSurf, _outSurf, _data) {
|
||||||
|
var _exp = _data[1];
|
||||||
|
var _con = _data[2];
|
||||||
|
surface_set_target(_outSurf);
|
||||||
|
draw_clear_alpha(0, 0);
|
||||||
|
|
||||||
|
shader_set(sh_bw);
|
||||||
|
shader_set_uniform_f(uniform_exp, _exp);
|
||||||
|
shader_set_uniform_f(uniform_con, _con);
|
||||||
|
draw_surface(_inSurf, 0, 0);
|
||||||
|
shader_reset();
|
||||||
|
surface_reset_target();
|
||||||
|
|
||||||
|
return _outSurf;
|
||||||
|
}
|
||||||
|
}
|
12
scripts/node_high_pass/node_bw.yy
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"isDnD": false,
|
||||||
|
"isCompatibility": false,
|
||||||
|
"parent": {
|
||||||
|
"name": "filter",
|
||||||
|
"path": "folders/nodes/data/filter.yy",
|
||||||
|
},
|
||||||
|
"resourceVersion": "1.0",
|
||||||
|
"name": "node_bw",
|
||||||
|
"tags": [],
|
||||||
|
"resourceType": "GMScript",
|
||||||
|
}
|
12
scripts/node_high_pass/node_color_adjustment.yy
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"isDnD": false,
|
||||||
|
"isCompatibility": false,
|
||||||
|
"parent": {
|
||||||
|
"name": "filter",
|
||||||
|
"path": "folders/nodes/data/filter.yy",
|
||||||
|
},
|
||||||
|
"resourceVersion": "1.0",
|
||||||
|
"name": "node_color_adjustment",
|
||||||
|
"tags": [],
|
||||||
|
"resourceType": "GMScript",
|
||||||
|
}
|
12
scripts/node_high_pass/node_color_replacement.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_color_replacement",
|
||||||
|
"tags": [],
|
||||||
|
"resourceType": "GMScript",
|
||||||
|
}
|
12
scripts/node_high_pass/node_greyscale.yy
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"isDnD": false,
|
||||||
|
"isCompatibility": false,
|
||||||
|
"parent": {
|
||||||
|
"name": "filter",
|
||||||
|
"path": "folders/nodes/data/filter.yy",
|
||||||
|
},
|
||||||
|
"resourceVersion": "1.0",
|
||||||
|
"name": "node_greyscale",
|
||||||
|
"tags": [],
|
||||||
|
"resourceType": "GMScript",
|
||||||
|
}
|
58
scripts/node_high_pass/node_high_pass.gml
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
function Node_High_Pass(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||||
|
name = "High_Pass";
|
||||||
|
|
||||||
|
newInput(0, nodeValue_Surface("Surface in", self));
|
||||||
|
|
||||||
|
newInput(1, nodeValue_Bool("Active", self, true));
|
||||||
|
active_index = 1;
|
||||||
|
|
||||||
|
newInput(2, nodeValue_Surface("Mask", self));
|
||||||
|
|
||||||
|
newInput(3, nodeValue_Float("Mix", self, 1))
|
||||||
|
.setDisplay(VALUE_DISPLAY.slider);
|
||||||
|
|
||||||
|
newInput(4, nodeValue_Toggle("Channel", self, 0b1111, { data: array_create(4, THEME.inspector_channel) }));
|
||||||
|
|
||||||
|
__init_mask_modifier(2); // inputs 5, 6,
|
||||||
|
|
||||||
|
newInput(7, nodeValue_Int("Radius", self, 1));
|
||||||
|
|
||||||
|
newInput(8, nodeValue_Float("Intensity", self, 1));
|
||||||
|
|
||||||
|
input_display_list = [ 1, 4,
|
||||||
|
["Surfaces", true], 0, 2, 3, 5, 6,
|
||||||
|
["Sharpen", false], 7, 8,
|
||||||
|
]
|
||||||
|
|
||||||
|
newOutput(0, nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone));
|
||||||
|
|
||||||
|
attribute_surface_depth();
|
||||||
|
attribute_oversample();
|
||||||
|
|
||||||
|
static step = function() {
|
||||||
|
__step_mask_modifier();
|
||||||
|
}
|
||||||
|
|
||||||
|
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
||||||
|
|
||||||
|
var _rad = _data[7];
|
||||||
|
var _int = _data[8];
|
||||||
|
var _dim = surface_get_dimension(_data[0]);
|
||||||
|
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1]);
|
||||||
|
|
||||||
|
surface_set_shader(_outSurf, sh_high_pass, true, BLEND.over);
|
||||||
|
shader_set_i("sampleMode", attributes.oversample);
|
||||||
|
shader_set_2("dimension", _dim);
|
||||||
|
shader_set_f("radius", _rad);
|
||||||
|
shader_set_f("intensity", _int);
|
||||||
|
|
||||||
|
draw_surface_safe(_data[0]);
|
||||||
|
surface_reset_shader();
|
||||||
|
|
||||||
|
__process_mask_modifier(_data);
|
||||||
|
_outSurf = mask_apply(_data[0], _outSurf, _data[2], _data[3]);
|
||||||
|
_outSurf = channel_apply(_data[0], _outSurf, _data[4]);
|
||||||
|
|
||||||
|
return _outSurf;
|
||||||
|
}
|
||||||
|
}
|
13
scripts/node_high_pass/node_high_pass.yy
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"$GMScript":"v1",
|
||||||
|
"%Name":"node_high_pass",
|
||||||
|
"isCompatibility":false,
|
||||||
|
"isDnD":false,
|
||||||
|
"name":"node_high_pass",
|
||||||
|
"parent":{
|
||||||
|
"name":"blur",
|
||||||
|
"path":"folders/nodes/data/filter/blur.yy",
|
||||||
|
},
|
||||||
|
"resourceType":"GMScript",
|
||||||
|
"resourceVersion":"2.0",
|
||||||
|
}
|
12
scripts/node_high_pass/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",
|
||||||
|
}
|
@ -12,20 +12,18 @@ function Node_HTTP_request(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||||||
|
|
||||||
address_domain = "";
|
address_domain = "";
|
||||||
|
|
||||||
static update = function() {
|
insp1UpdateTooltip = "Trigger";
|
||||||
|
insp1UpdateIcon = [ THEME.sequence_control, 1, COLORS._main_value_positive ];
|
||||||
|
|
||||||
|
static onInspector1Update = function() {
|
||||||
|
request();
|
||||||
|
}
|
||||||
|
|
||||||
|
static request = function() {
|
||||||
var _addr = getInputData(0);
|
var _addr = getInputData(0);
|
||||||
var _type = getInputData(1);
|
var _type = getInputData(1);
|
||||||
var _post = getInputData(2);
|
var _post = getInputData(2);
|
||||||
|
|
||||||
inputs[2].setVisible(_type == 1, _type == 1);
|
|
||||||
|
|
||||||
if(_addr == "") return;
|
|
||||||
|
|
||||||
var _addrs = string_split(_addr, "/", true);
|
|
||||||
address_domain = array_safe_get(_addrs, 1, "");
|
|
||||||
draw_set_font(f_p0);
|
|
||||||
address_domain = string_cut_line(address_domain, 128);
|
|
||||||
|
|
||||||
switch(_type) {
|
switch(_type) {
|
||||||
case 0 :
|
case 0 :
|
||||||
asyncCall(http_get(_addr), function(param, data) /*=>*/ {
|
asyncCall(http_get(_addr), function(param, data) /*=>*/ {
|
||||||
@ -45,6 +43,21 @@ function Node_HTTP_request(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static update = function() {
|
||||||
|
var _addr = getInputData(0);
|
||||||
|
var _type = getInputData(1);
|
||||||
|
var _post = getInputData(2);
|
||||||
|
|
||||||
|
inputs[2].setVisible(_type == 1, _type == 1);
|
||||||
|
|
||||||
|
if(_addr == "") return;
|
||||||
|
|
||||||
|
draw_set_font(f_p0);
|
||||||
|
var _addrs = string_split(_addr, "/", true);
|
||||||
|
address_domain = array_safe_get(_addrs, 1, "");
|
||||||
|
address_domain = string_cut_line(address_domain, 128);
|
||||||
|
}
|
||||||
|
|
||||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
|
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
|
||||||
var addr = getInputData(0);
|
var addr = getInputData(0);
|
||||||
var bbox = drawGetBbox(xx, yy, _s);
|
var bbox = drawGetBbox(xx, yy, _s);
|
||||||
|
@ -11,16 +11,21 @@ function Node_Json_File_Write(_x, _y, _group = noone) : Node(_x, _y, _group) con
|
|||||||
newInput(1, nodeValue_Struct("Struct", self, {}))
|
newInput(1, nodeValue_Struct("Struct", self, {}))
|
||||||
.setVisible(true, true);
|
.setVisible(true, true);
|
||||||
|
|
||||||
input_display_list = [ 0, 1 ]
|
newInput(2, nodeValue_Bool("Pretty print", self, false));
|
||||||
|
|
||||||
|
input_display_list = [ 0, 1, 2 ]
|
||||||
|
|
||||||
static writeFile = function() {
|
static writeFile = function() {
|
||||||
var path = getInputData(0);
|
var path = getInputData(0);
|
||||||
|
|
||||||
if(path == "") return;
|
if(path == "") return;
|
||||||
if(filename_ext(path) != ".json")
|
if(filename_ext(path) != ".json")
|
||||||
path += ".json";
|
path += ".json";
|
||||||
|
|
||||||
var cont = getInputData(1);
|
var cont = getInputData(1);
|
||||||
json_save_struct(path, cont);
|
var pret = getInputData(2);
|
||||||
|
|
||||||
|
json_save_struct(path, cont, pret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static update = function(frame = CURRENT_FRAME) {
|
static update = function(frame = CURRENT_FRAME) {
|
||||||
|
@ -25,7 +25,7 @@ function Node_Polar(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
|||||||
new scrollItem("Inverse Square", s_node_curve, 1),
|
new scrollItem("Inverse Square", s_node_curve, 1),
|
||||||
new scrollItem("Logarithm", s_node_curve, 3), ]));
|
new scrollItem("Logarithm", s_node_curve, 3), ]));
|
||||||
|
|
||||||
newInput(10, nodeValue_Bool("Swap", self, false))
|
newInput(10, nodeValue_Bool("Swap", self, false));
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@ -35,21 +35,22 @@ function Node_Polar(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
|||||||
|
|
||||||
newInput(12, nodeValue_Vec2("Tile", self, [ 1, 1 ] ));
|
newInput(12, nodeValue_Vec2("Tile", self, [ 1, 1 ] ));
|
||||||
|
|
||||||
|
newInput(13, nodeValue_Rotation_Range("Range", self, [ 0, 360 ]));
|
||||||
|
|
||||||
newOutput(0, nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone));
|
newOutput(0, nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone));
|
||||||
|
|
||||||
input_display_list = [ 3, 4,
|
input_display_list = [ 3, 4,
|
||||||
["Surfaces", false], 0, 1, 2, 7, 8, 12,
|
["Surfaces", false], 0, 1, 2, 7, 8, 12,
|
||||||
["Effect", false], 5, 6, 11, 9, 10,
|
["Effect", false], 5, 6, 11, 9, 10, 13,
|
||||||
]
|
]
|
||||||
|
|
||||||
attribute_surface_depth();
|
attribute_surface_depth();
|
||||||
attribute_interpolation();
|
attribute_interpolation();
|
||||||
|
|
||||||
static step = function() { #region
|
static step = function() {
|
||||||
__step_mask_modifier();
|
__step_mask_modifier();
|
||||||
|
|
||||||
inputs[6].mappableStep();
|
inputs[6].mappableStep();
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
||||||
|
|
||||||
@ -60,6 +61,7 @@ function Node_Polar(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
|||||||
shader_set_f_map("blend", _data[6], _data[11], inputs[6]);
|
shader_set_f_map("blend", _data[6], _data[11], inputs[6]);
|
||||||
shader_set_i("swap", _data[10]);
|
shader_set_i("swap", _data[10]);
|
||||||
shader_set_2("tile", _data[12]);
|
shader_set_2("tile", _data[12]);
|
||||||
|
shader_set_2("range", _data[13]);
|
||||||
|
|
||||||
draw_surface_safe(_data[0]);
|
draw_surface_safe(_data[0]);
|
||||||
surface_reset_shader();
|
surface_reset_shader();
|
||||||
|
@ -508,7 +508,7 @@ function __initNodes() {
|
|||||||
|
|
||||||
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
|
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
|
||||||
|
|
||||||
global.__startPage = ds_list_size(NODE_CATEGORY);
|
global.__startPage = ds_list_size(NODE_CATEGORY);
|
||||||
|
|
||||||
#region io
|
#region io
|
||||||
var input = ds_list_create();
|
var input = ds_list_create();
|
||||||
@ -568,6 +568,7 @@ function __initNodes() {
|
|||||||
addNodeObject(transform, "Warp", s_node_warp, "Node_Warp", [1, Node_Warp], ["warp corner"], "Warp image by freely moving the corners.");
|
addNodeObject(transform, "Warp", s_node_warp, "Node_Warp", [1, Node_Warp], ["warp corner"], "Warp image by freely moving the corners.");
|
||||||
// addNodeObject(transform, "Perspective Warp",s_node_warp, "Node_Warp_Perspective",[1, Node_Warp_Perspective], ["warp perspective"], "Warp image by modifying perspective.");
|
// addNodeObject(transform, "Perspective Warp",s_node_warp, "Node_Warp_Perspective",[1, Node_Warp_Perspective], ["warp perspective"], "Warp image by modifying perspective.");
|
||||||
addNodeObject(transform, "Skew", s_node_skew, "Node_Skew", [1, Node_Skew], ["shear"], "Skew image horizontally, or vertically.");
|
addNodeObject(transform, "Skew", s_node_skew, "Node_Skew", [1, Node_Skew], ["shear"], "Skew image horizontally, or vertically.");
|
||||||
|
// addNodeObject(transform, "Grid Warp", s_node_warp_mesh, "Node_Grid_Warp", [1, Node_Grid_Warp], ["grid wrap"], "Wrap image by modifying mesh lacttice.");
|
||||||
addNodeObject(transform, "Mesh Warp", s_node_warp_mesh, "Node_Mesh_Warp", [1, Node_Mesh_Warp], ["mesh wrap"], "Wrap image by converting it to mesh, and using control points.");
|
addNodeObject(transform, "Mesh Warp", s_node_warp_mesh, "Node_Mesh_Warp", [1, Node_Mesh_Warp], ["mesh wrap"], "Wrap image by converting it to mesh, and using control points.");
|
||||||
addNodeObject(transform, "Polar", s_node_polar, "Node_Polar", [1, Node_Polar],, "Convert image to polar coordinate.");
|
addNodeObject(transform, "Polar", s_node_polar, "Node_Polar", [1, Node_Polar],, "Convert image to polar coordinate.");
|
||||||
addNodeObject(transform, "Area Warp", s_node_warp_area, "Node_Wrap_Area", [1, Node_Wrap_Area],, "Wrap image to fit area value (x, y, w, h).");
|
addNodeObject(transform, "Area Warp", s_node_warp_area, "Node_Wrap_Area", [1, Node_Wrap_Area],, "Wrap image to fit area value (x, y, w, h).");
|
||||||
@ -603,6 +604,7 @@ function __initNodes() {
|
|||||||
addNodeObject(filter, "Average", s_node_average, "Node_Average", [1, Node_Average],, "Average color of every pixels in the image.").setVersion(1110);
|
addNodeObject(filter, "Average", s_node_average, "Node_Average", [1, Node_Average],, "Average color of every pixels in the image.").setVersion(1110);
|
||||||
addNodeObject(filter, "Smear", s_node_smear, "Node_Smear", [1, Node_Smear],, "Stretch out brighter pixel in one direction.").setVersion(11670);
|
addNodeObject(filter, "Smear", s_node_smear, "Node_Smear", [1, Node_Smear],, "Stretch out brighter pixel in one direction.").setVersion(11670);
|
||||||
addNodeObject(filter, "Kuwahara", s_node_kuwahara, "Node_Kuwahara", [1, Node_Kuwahara],, "Apply Kuwahara filter. Creating a watercolor-like effect.").setVersion(11660);
|
addNodeObject(filter, "Kuwahara", s_node_kuwahara, "Node_Kuwahara", [1, Node_Kuwahara],, "Apply Kuwahara filter. Creating a watercolor-like effect.").setVersion(11660);
|
||||||
|
addNodeObject(filter, "High Pass", s_node_high_pass, "Node_High_Pass", [1, Node_High_Pass], ["sharpen"], "Apply high pass filter").setVersion(1_18_01_0);
|
||||||
addNodeObject(filter, "Brush", s_node_brush_linear, "Node_Brush_Linear", [1, Node_Brush_Linear],, "Apply brush effect.").patreonExtra();
|
addNodeObject(filter, "Brush", s_node_brush_linear, "Node_Brush_Linear", [1, Node_Brush_Linear],, "Apply brush effect.").patreonExtra();
|
||||||
|
|
||||||
ds_list_add(filter, "Warps");
|
ds_list_add(filter, "Warps");
|
||||||
|
@ -340,8 +340,8 @@ function Node_Repeat(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
|||||||
var _grad_map = _data[30];
|
var _grad_map = _data[30];
|
||||||
var _grad_range = _data[31];
|
var _grad_range = _data[31];
|
||||||
|
|
||||||
var _arr = _data[16];
|
var _arr = _data[16];
|
||||||
var _sed = _data[17];
|
var _sed = _data[17];
|
||||||
|
|
||||||
var _col = _data[18];
|
var _col = _data[18];
|
||||||
var _cls = _data[19];
|
var _cls = _data[19];
|
||||||
@ -517,11 +517,11 @@ function Node_Repeat(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
|||||||
|
|
||||||
if(_an_selt == 0) { // index
|
if(_an_selt == 0) { // index
|
||||||
if(i < _an_sind - _an_srng - _an_sfal || i > _an_sind + _an_srng + _an_sfal)
|
if(i < _an_sind - _an_srng - _an_sfal || i > _an_sind + _an_srng + _an_sfal)
|
||||||
_inf = 0;
|
|
||||||
else if (_an_sfal > 0 && (i < _an_sind - _an_srng || i > _an_sind + _an_srng))
|
|
||||||
_inf = 1 - clamp(min(abs(i - (_an_sind - _an_srng)), abs(i - (_an_sind + _an_srng))) / _an_sfal, 0, 1);
|
|
||||||
else
|
|
||||||
_inf = 1;
|
_inf = 1;
|
||||||
|
else if (_an_sfal > 0 && (i < _an_sind - _an_srng || i > _an_sind + _an_srng))
|
||||||
|
_inf = clamp(min(abs(i - (_an_sind - _an_srng)), abs(i - (_an_sind + _an_srng))) / _an_sfal, 0, 1);
|
||||||
|
else
|
||||||
|
_inf = 0;
|
||||||
|
|
||||||
} else if(_an_selt == 1) { // area
|
} else if(_an_selt == 1) { // area
|
||||||
_inf = 1 - area_point_in_fallout(_an_sare, _x, _y, _an_sfal);
|
_inf = 1 - area_point_in_fallout(_an_sare, _x, _y, _an_sfal);
|
||||||
|
@ -2001,7 +2001,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||||||
return drawJuncConnection(value_from, self, params);
|
return drawJuncConnection(value_from, self, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
static drawConnectionMouse = function(params, _mx, _my, target) {
|
static drawConnectionMouse = function(params, _mx, _my, target = noone) {
|
||||||
var ss = params.s;
|
var ss = params.s;
|
||||||
var aa = params.aa; // 1
|
var aa = params.aa; // 1
|
||||||
|
|
||||||
@ -2023,7 +2023,8 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||||||
_mx *= aa;
|
_mx *= aa;
|
||||||
_my *= aa;
|
_my *= aa;
|
||||||
|
|
||||||
var col = color_display;
|
var _fade = PREFERENCES.connection_line_highlight_fade;
|
||||||
|
var col = merge_color(_fade, color_display, .5);
|
||||||
draw_set_color(col);
|
draw_set_color(col);
|
||||||
|
|
||||||
var _action = type == VALUE_TYPE.action;
|
var _action = type == VALUE_TYPE.action;
|
||||||
@ -2031,6 +2032,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||||||
|
|
||||||
switch(PREFERENCES.curve_connection_line) {
|
switch(PREFERENCES.curve_connection_line) {
|
||||||
case 0 : draw_line_width(sx, sy, _mx, _my, th); break;
|
case 0 : draw_line_width(sx, sy, _mx, _my, th); break;
|
||||||
|
|
||||||
case 1 :
|
case 1 :
|
||||||
if(drawCorner) {
|
if(drawCorner) {
|
||||||
if(_action) draw_line_curve_corner(_mx, _my, sx, sy, ss, th, col, col);
|
if(_action) draw_line_curve_corner(_mx, _my, sx, sy, ss, th, col, col);
|
||||||
@ -2040,6 +2042,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||||||
else draw_line_curve_color(sx, sy, _mx, _my,,, ss, th, col, col);
|
else draw_line_curve_color(sx, sy, _mx, _my,,, ss, th, col, col);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2 :
|
case 2 :
|
||||||
if(drawCorner) {
|
if(drawCorner) {
|
||||||
if(_action) draw_line_elbow_corner(_mx, _my, sx, sy, ss, th, col, col, corner);
|
if(_action) draw_line_elbow_corner(_mx, _my, sx, sy, ss, th, col, col, corner);
|
||||||
@ -2049,6 +2052,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||||||
else draw_line_elbow_color(_mx, _my, sx, sy,,, ss, th, col, col, corner);
|
else draw_line_elbow_color(_mx, _my, sx, sy,,, ss, th, col, col, corner);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3 :
|
case 3 :
|
||||||
if(drawCorner) {
|
if(drawCorner) {
|
||||||
if(_action) draw_line_elbow_diag_corner(_mx, _my, sx, sy, ss, th, col, col, corner);
|
if(_action) draw_line_elbow_diag_corner(_mx, _my, sx, sy, ss, th, col, col, corner);
|
||||||
@ -2059,6 +2063,9 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__draw_sprite_ext(THEME.node_junctions_bg_x2, draw_junction_index, _mx, _my, ss / 2, ss / 2, 0, draw_bg, 1);
|
||||||
|
__draw_sprite_ext(THEME.node_junctions_outline_x2, draw_junction_index, _mx, _my, ss / 2, ss / 2, 0, col, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/////========== EXPRESSION ==========
|
/////========== EXPRESSION ==========
|
||||||
|
@ -5,18 +5,18 @@ function ValueValidator() constructor {
|
|||||||
function VV_min(minimum) { return new __VV_min(minimum); };
|
function VV_min(minimum) { return new __VV_min(minimum); };
|
||||||
function __VV_min(minimum) : ValueValidator() constructor {
|
function __VV_min(minimum) : ValueValidator() constructor {
|
||||||
self.minimum = minimum;
|
self.minimum = minimum;
|
||||||
static validate = function(val) { return max(minimum, val); }
|
static validate = function(val) { return is_array(val)? array_map(val, function(v) /*=>*/ {return validate(v)}) : max(minimum, val); }
|
||||||
}
|
}
|
||||||
|
|
||||||
function VV_max(maximum) { return new __VV_max(maximum); };
|
function VV_max(maximum) { return new __VV_max(maximum); };
|
||||||
function __VV_max(maximum) : ValueValidator() constructor {
|
function __VV_max(maximum) : ValueValidator() constructor {
|
||||||
self.maximum = maximum;
|
self.maximum = maximum;
|
||||||
static validate = function(val) { return min(maximum, val); }
|
static validate = function(val) { return is_array(val)? array_map(val, function(v) /*=>*/ {return validate(v)}) : min(maximum, val); }
|
||||||
}
|
}
|
||||||
|
|
||||||
function VV_clamp(minimum, maximum) { return new __VV_clamp(minimum, maximum); };
|
function VV_clamp(minimum, maximum) { return new __VV_clamp(minimum, maximum); };
|
||||||
function __VV_clamp(minimum, maximum) : ValueValidator() constructor {
|
function __VV_clamp(minimum, maximum) : ValueValidator() constructor {
|
||||||
self.minimum = minimum;
|
self.minimum = minimum;
|
||||||
self.maximum = maximum;
|
self.maximum = maximum;
|
||||||
static validate = function(val) { return clamp(val, minimum, maximum); }
|
static validate = function(val) { return is_array(val)? array_map(val, function(v) /*=>*/ {return validate(v)}) : clamp(val, minimum, maximum); }
|
||||||
}
|
}
|
||||||
|
@ -279,7 +279,7 @@ function Panel_Collection() : PanelContent() constructor {
|
|||||||
tb_search = new textBox(TEXTBOX_INPUT.text, function(str) /*=>*/ { search_string = string(str); doSearch(); });
|
tb_search = new textBox(TEXTBOX_INPUT.text, function(str) /*=>*/ { search_string = string(str); doSearch(); });
|
||||||
tb_search.auto_update = true;
|
tb_search.auto_update = true;
|
||||||
|
|
||||||
grid_size = ui(48);
|
grid_size = ui(56);
|
||||||
grid_size_to = grid_size;
|
grid_size_to = grid_size;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
@ -667,7 +667,7 @@ function Panel_Collection() : PanelContent() constructor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var ss = grid_size / 96;
|
var ss = grid_size / (max(sprite_get_width(_node.spr), sprite_get_height(_node.spr)) + 16);
|
||||||
var sx = _boxx + grid_size / 2;
|
var sx = _boxx + grid_size / 2;
|
||||||
var sy = yy + grid_size / 2;
|
var sy = yy + grid_size / 2;
|
||||||
|
|
||||||
|
@ -271,7 +271,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||||||
show_dimension : true,
|
show_dimension : true,
|
||||||
show_compute : true,
|
show_compute : true,
|
||||||
|
|
||||||
avoid_label : true,
|
avoid_label : false,
|
||||||
preview_scale : 100,
|
preview_scale : 100,
|
||||||
highlight : false,
|
highlight : false,
|
||||||
|
|
||||||
@ -295,6 +295,22 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||||||
|
|
||||||
tooltip_overlay[$ title] = keys;
|
tooltip_overlay[$ title] = keys;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tb_zoom_level = new textBox(TEXTBOX_INPUT.number, function(z) /*=>*/ {
|
||||||
|
var _s = graph_s;
|
||||||
|
|
||||||
|
graph_s_to = clamp(z, 0.01, 2);
|
||||||
|
graph_s = graph_s_to;
|
||||||
|
|
||||||
|
if(_s != graph_s) {
|
||||||
|
graph_x += w / 2 * ((1 / graph_s) - (1 / _s));
|
||||||
|
graph_y += h / 2 * ((1 / graph_s) - (1 / _s));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
tb_zoom_level.color = c_white;
|
||||||
|
tb_zoom_level.align = fa_right;
|
||||||
|
tb_zoom_level.hide = 3;
|
||||||
|
tb_zoom_level.font = f_p2;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region // ---- position ----
|
#region // ---- position ----
|
||||||
@ -382,9 +398,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||||||
node_hover = noone;
|
node_hover = noone;
|
||||||
|
|
||||||
junction_hovering = noone;
|
junction_hovering = noone;
|
||||||
add_node_draw_junc = false;
|
add_node_draw_junc = noone;
|
||||||
add_node_draw_x_fix = 0;
|
|
||||||
add_node_draw_y_fix = 0;
|
|
||||||
add_node_draw_x = 0;
|
add_node_draw_x = 0;
|
||||||
add_node_draw_y = 0;
|
add_node_draw_y = 0;
|
||||||
|
|
||||||
@ -1478,179 +1492,189 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||||||
printIf(log, $"Draw active: {get_timer() - t}"); t = get_timer();
|
printIf(log, $"Draw active: {get_timer() - t}"); t = get_timer();
|
||||||
|
|
||||||
// draw connections
|
// draw connections
|
||||||
var aa = floor(min(8192 / w, 8192 / h, PREFERENCES.connection_line_aa));
|
var aa = floor(min(8192 / w, 8192 / h, PREFERENCES.connection_line_aa));
|
||||||
|
|
||||||
connection_surface = surface_verify(connection_surface, w * aa, h * aa);
|
|
||||||
connection_surface_aa = surface_verify(connection_surface_aa, w, h);
|
|
||||||
surface_set_target(connection_surface);
|
|
||||||
DRAW_CLEAR
|
|
||||||
|
|
||||||
var hov = noone;
|
connection_surface = surface_verify(connection_surface, w * aa, h * aa);
|
||||||
var hoverable = !bool(node_dragging) && pHOVER;
|
connection_surface_aa = surface_verify(connection_surface_aa, w, h);
|
||||||
var param = connection_param;
|
surface_set_target(connection_surface);
|
||||||
|
DRAW_CLEAR
|
||||||
param.active = hoverable;
|
|
||||||
param.setPos(gr_x, gr_y, graph_s, mx, my);
|
var hov = noone;
|
||||||
param.setBoundary(-64, -64, w + 64, h + 64);
|
var hoverable = !bool(node_dragging) && pHOVER;
|
||||||
param.setProp(array_length(nodes_list), display_parameter.highlight);
|
var param = connection_param;
|
||||||
param.setDraw(aa, bg_color);
|
|
||||||
|
|
||||||
for(var i = 0; i < array_length(nodes_list); i++) {
|
|
||||||
var _node = nodes_list[i];
|
|
||||||
if(!display_parameter.show_control && _node.is_controller) continue;
|
|
||||||
|
|
||||||
param.cur_layer = i + 1;
|
|
||||||
|
|
||||||
var _hov = _node.drawConnections(param);
|
|
||||||
if(_hov != noone && is_struct(_hov)) hov = _hov;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(value_dragging && connection_draw_mouse != noone && !key_mod_press(SHIFT)) {
|
param.active = hoverable;
|
||||||
var _cmx = connection_draw_mouse[0];
|
param.setPos(gr_x, gr_y, graph_s, mx, my);
|
||||||
var _cmy = connection_draw_mouse[1];
|
param.setBoundary(-64, -64, w + 64, h + 64);
|
||||||
var _cmt = connection_draw_target;
|
param.setProp(array_length(nodes_list), display_parameter.highlight);
|
||||||
|
param.setDraw(aa, bg_color);
|
||||||
|
|
||||||
|
for(var i = 0; i < array_length(nodes_list); i++) {
|
||||||
|
var _node = nodes_list[i];
|
||||||
|
if(!display_parameter.show_control && _node.is_controller) continue;
|
||||||
|
|
||||||
|
param.cur_layer = i + 1;
|
||||||
|
|
||||||
|
var _hov = _node.drawConnections(param);
|
||||||
|
if(_hov != noone && is_struct(_hov)) hov = _hov;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(value_dragging && connection_draw_mouse != noone && !key_mod_press(SHIFT)) {
|
||||||
|
var _cmx = connection_draw_mouse[0];
|
||||||
|
var _cmy = connection_draw_mouse[1];
|
||||||
|
var _cmt = connection_draw_target;
|
||||||
|
|
||||||
|
if(array_empty(value_draggings))
|
||||||
|
value_dragging.drawConnectionMouse(param, _cmx, _cmy, _cmt);
|
||||||
|
else {
|
||||||
|
var _stIndex = array_find(value_draggings, value_dragging);
|
||||||
|
|
||||||
|
for( var i = 0, n = array_length(value_draggings); i < n; i++ ) {
|
||||||
|
var _dmx = _cmx;
|
||||||
|
var _dmy = value_draggings[i].connect_type == CONNECT_TYPE.output? _cmy + (i - _stIndex) * 24 * graph_s : _cmy;
|
||||||
|
|
||||||
if(array_empty(value_draggings))
|
value_draggings[i].drawConnectionMouse(param, _dmx, _dmy, _cmt);
|
||||||
value_dragging.drawConnectionMouse(param, _cmx, _cmy, _cmt);
|
|
||||||
else {
|
|
||||||
var _stIndex = array_find(value_draggings, value_dragging);
|
|
||||||
|
|
||||||
for( var i = 0, n = array_length(value_draggings); i < n; i++ ) {
|
|
||||||
var _dmx = _cmx;
|
|
||||||
var _dmy = value_draggings[i].connect_type == CONNECT_TYPE.output? _cmy + (i - _stIndex) * 24 * graph_s : _cmy;
|
|
||||||
|
|
||||||
value_draggings[i].drawConnectionMouse(param, _dmx, _dmy, _cmt);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if(add_node_draw_junc != noone) {
|
||||||
surface_reset_target();
|
|
||||||
|
if(!instance_exists(o_dialog_add_node))
|
||||||
gpu_set_texfilter(true);
|
add_node_draw_junc = noone;
|
||||||
surface_set_shader(connection_surface_aa, sh_downsample);
|
else {
|
||||||
shader_set_f("down", aa);
|
var _amx = gr_x + add_node_draw_x * graph_s;
|
||||||
shader_set_dim("dimension", connection_surface);
|
var _amy = gr_y + add_node_draw_y * graph_s;
|
||||||
draw_surface_safe(connection_surface);
|
|
||||||
surface_reset_shader();
|
add_node_draw_junc.drawConnectionMouse(param, _amx, _amy);
|
||||||
gpu_set_texfilter(false);
|
}
|
||||||
|
}
|
||||||
BLEND_ALPHA_MULP
|
|
||||||
draw_surface_safe(connection_surface_aa);
|
surface_reset_target();
|
||||||
BLEND_NORMAL
|
|
||||||
|
gpu_set_texfilter(true);
|
||||||
junction_hovering = node_hovering == noone? hov : noone;
|
surface_set_shader(connection_surface_aa, sh_downsample);
|
||||||
|
shader_set_f("down", aa);
|
||||||
|
shader_set_dim("dimension", connection_surface);
|
||||||
|
draw_surface_safe(connection_surface);
|
||||||
|
surface_reset_shader();
|
||||||
|
gpu_set_texfilter(false);
|
||||||
|
|
||||||
|
BLEND_ALPHA_MULP
|
||||||
|
draw_surface_safe(connection_surface_aa);
|
||||||
|
BLEND_NORMAL
|
||||||
|
|
||||||
|
junction_hovering = node_hovering == noone? hov : noone;
|
||||||
|
|
||||||
printIf(log, $"Draw connection: {get_timer() - t}"); t = get_timer();
|
printIf(log, $"Draw connection: {get_timer() - t}"); t = get_timer();
|
||||||
|
|
||||||
// draw node
|
// draw node
|
||||||
_value_focus = value_focus;
|
_value_focus = value_focus;
|
||||||
value_focus = noone;
|
value_focus = noone;
|
||||||
|
|
||||||
var t = get_timer();
|
var t = get_timer();
|
||||||
for(var i = 0; i < array_length(nodes_list); i++) {
|
for(var i = 0; i < array_length(nodes_list); i++) {
|
||||||
var _node = nodes_list[i];
|
var _node = nodes_list[i];
|
||||||
|
|
||||||
if(!display_parameter.show_control && _node.is_controller) continue;
|
|
||||||
nodes_list[i].drawNodeBehind(gr_x, gr_y, mx, my, graph_s);
|
|
||||||
}
|
|
||||||
|
|
||||||
for( var i = 0, n = array_length(value_draggings); i < n; i++ )
|
if(!display_parameter.show_control && _node.is_controller) continue;
|
||||||
value_draggings[i].graph_selecting = true;
|
nodes_list[i].drawNodeBehind(gr_x, gr_y, mx, my, graph_s);
|
||||||
|
}
|
||||||
for(var i = 0; i < array_length(nodes_list); i++) {
|
|
||||||
var _node = nodes_list[i];
|
|
||||||
|
|
||||||
if(!display_parameter.show_control && _node.is_controller) continue;
|
|
||||||
if(is_instanceof(_node, Node_Frame)) continue;
|
|
||||||
try {
|
|
||||||
var val = _node.drawNode(gr_x, gr_y, mx, my, graph_s, display_parameter, self);
|
|
||||||
if(val) {
|
|
||||||
value_focus = val;
|
|
||||||
if(key_mod_press(SHIFT)) TOOLTIP = [ val.getValue(), val.type ];
|
|
||||||
}
|
|
||||||
} catch(e) {
|
|
||||||
log_warning("NODE DRAW", exception_print(e));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for(var i = 0; i < array_length(nodes_list); i++) {
|
|
||||||
var _node = nodes_list[i];
|
|
||||||
|
|
||||||
if(!display_parameter.show_control && _node.is_controller) continue;
|
|
||||||
if(!is_instanceof(nodes_list[i], Node_Frame))
|
|
||||||
nodes_list[i].drawBadge(gr_x, gr_y, graph_s);
|
|
||||||
}
|
|
||||||
|
|
||||||
for(var i = 0; i < array_length(nodes_list); i++) {
|
|
||||||
var _node = nodes_list[i];
|
|
||||||
|
|
||||||
if(!display_parameter.show_control && _node.is_controller) continue;
|
|
||||||
nodes_list[i].drawNodeFG(gr_x, gr_y, mx, my, graph_s, display_parameter, self);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(PANEL_INSPECTOR && PANEL_INSPECTOR.prop_hover != noone)
|
|
||||||
value_focus = PANEL_INSPECTOR.prop_hover;
|
|
||||||
|
|
||||||
|
for( var i = 0, n = array_length(value_draggings); i < n; i++ )
|
||||||
|
value_draggings[i].graph_selecting = true;
|
||||||
|
|
||||||
|
for(var i = 0; i < array_length(nodes_list); i++) {
|
||||||
|
var _node = nodes_list[i];
|
||||||
|
|
||||||
|
if(!display_parameter.show_control && _node.is_controller) continue;
|
||||||
|
if(is_instanceof(_node, Node_Frame)) continue;
|
||||||
|
try {
|
||||||
|
var val = _node.drawNode(gr_x, gr_y, mx, my, graph_s, display_parameter, self);
|
||||||
|
if(val) {
|
||||||
|
value_focus = val;
|
||||||
|
if(key_mod_press(SHIFT)) TOOLTIP = [ val.getValue(), val.type ];
|
||||||
|
}
|
||||||
|
} catch(e) {
|
||||||
|
log_warning("NODE DRAW", exception_print(e));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for(var i = 0; i < array_length(nodes_list); i++) {
|
||||||
|
var _node = nodes_list[i];
|
||||||
|
|
||||||
|
if(!display_parameter.show_control && _node.is_controller) continue;
|
||||||
|
if(!is_instanceof(nodes_list[i], Node_Frame))
|
||||||
|
nodes_list[i].drawBadge(gr_x, gr_y, graph_s);
|
||||||
|
}
|
||||||
|
|
||||||
|
for(var i = 0; i < array_length(nodes_list); i++) {
|
||||||
|
var _node = nodes_list[i];
|
||||||
|
|
||||||
|
if(!display_parameter.show_control && _node.is_controller) continue;
|
||||||
|
nodes_list[i].drawNodeFG(gr_x, gr_y, mx, my, graph_s, display_parameter, self);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(PANEL_INSPECTOR && PANEL_INSPECTOR.prop_hover != noone)
|
||||||
|
value_focus = PANEL_INSPECTOR.prop_hover;
|
||||||
|
|
||||||
printIf(log, $"Draw node: {get_timer() - t}"); t = get_timer();
|
printIf(log, $"Draw node: {get_timer() - t}"); t = get_timer();
|
||||||
|
|
||||||
// dragging
|
// dragging
|
||||||
if(mouse_press(mb_left))
|
if(mouse_press(mb_left))
|
||||||
node_dragging = noone;
|
node_dragging = noone;
|
||||||
|
|
||||||
|
for(var i = 0; i < array_length(nodes_list); i++)
|
||||||
|
nodes_list[i].groupCheck(gr_x, gr_y, graph_s, mx, my);
|
||||||
|
|
||||||
|
if(node_dragging && !key_mod_press(ALT)) {
|
||||||
|
addKeyOverlay("Dragging node(s)", [[ "Ctrl", "Disable snapping" ]]);
|
||||||
|
|
||||||
for(var i = 0; i < array_length(nodes_list); i++)
|
var nx = node_drag_sx + (mouse_graph_x - node_drag_mx);
|
||||||
nodes_list[i].groupCheck(gr_x, gr_y, graph_s, mx, my);
|
var ny = node_drag_sy + (mouse_graph_y - node_drag_my);
|
||||||
|
|
||||||
if(node_dragging && !key_mod_press(ALT)) {
|
|
||||||
addKeyOverlay("Dragging node(s)", [[ "Ctrl", "Disable snapping" ]]);
|
|
||||||
|
|
||||||
var nx = node_drag_sx + (mouse_graph_x - node_drag_mx);
|
if(!key_mod_press(CTRL) && project.graphGrid.snap) {
|
||||||
var ny = node_drag_sy + (mouse_graph_y - node_drag_my);
|
nx = round(nx / project.graphGrid.size) * project.graphGrid.size;
|
||||||
|
ny = round(ny / project.graphGrid.size) * project.graphGrid.size;
|
||||||
if(!key_mod_press(CTRL) && project.graphGrid.snap) {
|
|
||||||
nx = round(nx / project.graphGrid.size) * project.graphGrid.size;
|
|
||||||
ny = round(ny / project.graphGrid.size) * project.graphGrid.size;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(node_drag_ox == -1 || node_drag_oy == -1) {
|
|
||||||
node_drag_ox = nx;
|
|
||||||
node_drag_oy = ny;
|
|
||||||
} else if(nx != node_drag_ox || ny != node_drag_oy) {
|
|
||||||
var dx = nx - node_drag_ox;
|
|
||||||
var dy = ny - node_drag_oy;
|
|
||||||
|
|
||||||
for(var i = 0; i < array_length(nodes_selecting); i++) {
|
|
||||||
var _node = nodes_selecting[i];
|
|
||||||
var _nx = _node.x + dx;
|
|
||||||
var _ny = _node.y + dy;
|
|
||||||
|
|
||||||
if(!key_mod_press(CTRL) && project.graphGrid.snap) {
|
|
||||||
_nx = round(_nx / project.graphGrid.size) * project.graphGrid.size;
|
|
||||||
_ny = round(_ny / project.graphGrid.size) * project.graphGrid.size;
|
|
||||||
}
|
|
||||||
|
|
||||||
_node.move(_nx, _ny, graph_s);
|
|
||||||
}
|
|
||||||
|
|
||||||
node_drag_ox = nx;
|
|
||||||
node_drag_oy = ny;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(mouse_release(mb_left) && (nx != node_drag_sx || ny != node_drag_sy)) {
|
|
||||||
var shfx = node_drag_sx - nx;
|
|
||||||
var shfy = node_drag_sy - ny;
|
|
||||||
|
|
||||||
UNDO_HOLDING = false;
|
|
||||||
for(var i = 0; i < array_length(nodes_selecting); i++) {
|
|
||||||
var _n = nodes_selecting[i];
|
|
||||||
if(_n == noone) continue;
|
|
||||||
recordAction(ACTION_TYPE.var_modify, _n, [ _n.x + shfx, "x", "node x position" ]);
|
|
||||||
recordAction(ACTION_TYPE.var_modify, _n, [ _n.y + shfy, "y", "node y position" ]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mouse_release(mb_left))
|
if(node_drag_ox == -1 || node_drag_oy == -1) {
|
||||||
node_dragging = noone;
|
node_drag_ox = nx;
|
||||||
|
node_drag_oy = ny;
|
||||||
|
} else if(nx != node_drag_ox || ny != node_drag_oy) {
|
||||||
|
var dx = nx - node_drag_ox;
|
||||||
|
var dy = ny - node_drag_oy;
|
||||||
|
|
||||||
|
for(var i = 0; i < array_length(nodes_selecting); i++) {
|
||||||
|
var _node = nodes_selecting[i];
|
||||||
|
var _nx = _node.x + dx;
|
||||||
|
var _ny = _node.y + dy;
|
||||||
|
|
||||||
|
if(!key_mod_press(CTRL) && project.graphGrid.snap) {
|
||||||
|
_nx = round(_nx / project.graphGrid.size) * project.graphGrid.size;
|
||||||
|
_ny = round(_ny / project.graphGrid.size) * project.graphGrid.size;
|
||||||
|
}
|
||||||
|
|
||||||
|
_node.move(_nx, _ny, graph_s);
|
||||||
|
}
|
||||||
|
|
||||||
|
node_drag_ox = nx;
|
||||||
|
node_drag_oy = ny;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(mouse_release(mb_left) && (nx != node_drag_sx || ny != node_drag_sy)) {
|
||||||
|
var shfx = node_drag_sx - nx;
|
||||||
|
var shfy = node_drag_sy - ny;
|
||||||
|
|
||||||
|
UNDO_HOLDING = false;
|
||||||
|
for(var i = 0; i < array_length(nodes_selecting); i++) {
|
||||||
|
var _n = nodes_selecting[i];
|
||||||
|
if(_n == noone) continue;
|
||||||
|
recordAction(ACTION_TYPE.var_modify, _n, [ _n.x + shfx, "x", "node x position" ]);
|
||||||
|
recordAction(ACTION_TYPE.var_modify, _n, [ _n.y + shfy, "y", "node y position" ]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(mouse_release(mb_left))
|
||||||
|
node_dragging = noone;
|
||||||
|
|
||||||
printIf(log, $"Drag node time : {get_timer() - t}"); t = get_timer();
|
printIf(log, $"Drag node time : {get_timer() - t}"); t = get_timer();
|
||||||
|
|
||||||
@ -1680,70 +1704,70 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// draw selection frame
|
// draw selection frame
|
||||||
if(nodes_select_drag) {
|
if(nodes_select_drag) {
|
||||||
if(point_distance(nodes_select_mx, nodes_select_my, mx, my) > 16)
|
if(point_distance(nodes_select_mx, nodes_select_my, mx, my) > 16)
|
||||||
nodes_select_drag = 2;
|
nodes_select_drag = 2;
|
||||||
|
|
||||||
|
if(nodes_select_drag == 2) {
|
||||||
|
draw_sprite_stretched_points_clamp(THEME.ui_selection, 0, nodes_select_mx, nodes_select_my, mx, my, COLORS._main_accent);
|
||||||
|
|
||||||
if(nodes_select_drag == 2) {
|
for(var i = 0; i < array_length(nodes_list); i++) {
|
||||||
draw_sprite_stretched_points_clamp(THEME.ui_selection, 0, nodes_select_mx, nodes_select_my, mx, my, COLORS._main_accent);
|
var _node = nodes_list[i];
|
||||||
|
|
||||||
for(var i = 0; i < array_length(nodes_list); i++) {
|
if(!display_parameter.show_control && _node.is_controller) continue;
|
||||||
var _node = nodes_list[i];
|
if(!_node.selectable) continue;
|
||||||
|
if(is_instanceof(_node, Node_Frame) && !nodes_select_frame) continue;
|
||||||
if(!display_parameter.show_control && _node.is_controller) continue;
|
|
||||||
if(!_node.selectable) continue;
|
var _x = (_node.x + graph_x) * graph_s;
|
||||||
if(is_instanceof(_node, Node_Frame) && !nodes_select_frame) continue;
|
var _y = (_node.y + graph_y) * graph_s;
|
||||||
|
var _w = _node.w * graph_s;
|
||||||
var _x = (_node.x + graph_x) * graph_s;
|
var _h = _node.h * graph_s;
|
||||||
var _y = (_node.y + graph_y) * graph_s;
|
|
||||||
var _w = _node.w * graph_s;
|
var _sel = _w && _h && rectangle_in_rectangle(_x, _y, _x + _w, _y + _h, nodes_select_mx, nodes_select_my, mx, my);
|
||||||
var _h = _node.h * graph_s;
|
|
||||||
|
if(!array_exists(nodes_selecting, _node) && _sel)
|
||||||
var _sel = _w && _h && rectangle_in_rectangle(_x, _y, _x + _w, _y + _h, nodes_select_mx, nodes_select_my, mx, my);
|
array_push(nodes_selecting, _node);
|
||||||
|
if(array_exists(nodes_selecting, _node) && !_sel)
|
||||||
if(!array_exists(nodes_selecting, _node) && _sel)
|
array_remove(nodes_selecting, _node);
|
||||||
array_push(nodes_selecting, _node);
|
|
||||||
if(array_exists(nodes_selecting, _node) && !_sel)
|
|
||||||
array_remove(nodes_selecting, _node);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mouse_release(mb_left))
|
|
||||||
nodes_select_drag = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(mouse_release(mb_left))
|
||||||
|
nodes_select_drag = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
if(nodes_junction_d != noone) {
|
shx = value_snap(shx, key_mod_press(CTRL)? 1 : 4);
|
||||||
var shx = nodes_junction_dx + (mx - nodes_select_mx) / graph_s;
|
shy = value_snap(shy, key_mod_press(CTRL)? 1 : 4);
|
||||||
var shy = nodes_junction_dy + (my - nodes_select_my) / graph_s;
|
|
||||||
|
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 && !node_bg_hovering && mouse_press(mb_left, _focus) && !graph_dragging_key && !graph_zooming_key) {
|
||||||
|
if(is_instanceof(junction_hovering, NodeValue) && 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;
|
||||||
|
|
||||||
shx = value_snap(shx, key_mod_press(CTRL)? 1 : 4);
|
} else if(array_empty(nodes_selecting) && !value_focus && !drag_locking) {
|
||||||
shy = value_snap(shy, key_mod_press(CTRL)? 1 : 4);
|
nodes_select_drag = 1;
|
||||||
|
nodes_select_frame = frame_hovering == noone;
|
||||||
|
|
||||||
nodes_junction_d.draw_line_shift_x = shx;
|
nodes_select_mx = mx;
|
||||||
nodes_junction_d.draw_line_shift_y = shy;
|
nodes_select_my = my;
|
||||||
|
|
||||||
if(mouse_release(mb_left))
|
|
||||||
nodes_junction_d = noone;
|
|
||||||
}
|
}
|
||||||
|
drag_locking = false;
|
||||||
if(mouse_on_graph && !node_bg_hovering && mouse_press(mb_left, _focus) && !graph_dragging_key && !graph_zooming_key) {
|
}
|
||||||
if(is_instanceof(junction_hovering, NodeValue) && 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(array_empty(nodes_selecting) && !value_focus && !drag_locking) {
|
|
||||||
nodes_select_drag = 1;
|
|
||||||
nodes_select_frame = frame_hovering == noone;
|
|
||||||
|
|
||||||
nodes_select_mx = mx;
|
|
||||||
nodes_select_my = my;
|
|
||||||
}
|
|
||||||
drag_locking = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
printIf(log, $"Draw selection frame : {get_timer() - t}"); t = get_timer();
|
printIf(log, $"Draw selection frame : {get_timer() - t}"); t = get_timer();
|
||||||
}
|
}
|
||||||
@ -1835,6 +1859,10 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||||||
|
|
||||||
alarm[0] = 1;
|
alarm[0] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
add_node_draw_junc = value_dragging;
|
||||||
|
add_node_draw_x = mouse_grid_x;
|
||||||
|
add_node_draw_y = mouse_grid_y;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2501,13 +2529,31 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||||||
|
|
||||||
drawNodes();
|
drawNodes();
|
||||||
|
|
||||||
draw_set_text(f_p2, fa_right, fa_top, COLORS._main_text_sub);
|
|
||||||
draw_text_add(w - ui(8), ovy, $"x{graph_s_to}");
|
|
||||||
|
|
||||||
drawJunctionConnect();
|
drawJunctionConnect();
|
||||||
drawContextFrame();
|
drawContextFrame();
|
||||||
|
|
||||||
mouse_on_graph = true;
|
mouse_on_graph = true;
|
||||||
|
|
||||||
|
#region draw metadata
|
||||||
|
draw_set_text(f_p2, fa_right, fa_top, COLORS._main_text_sub);
|
||||||
|
|
||||||
|
var _zms = $"x{graph_s_to}";
|
||||||
|
var _zmw = string_width(_zms) + ui(16);
|
||||||
|
var _zmh = string_height(_zms);
|
||||||
|
var _zmx = w;
|
||||||
|
var _zmc = tb_zoom_level.selecting || tb_zoom_level.hovering || tb_zoom_level.sliding? COLORS._main_text : COLORS._main_text_sub;
|
||||||
|
if(tb_zoom_level.hovering) mouse_on_graph = false;
|
||||||
|
|
||||||
|
tb_zoom_level.rx = x;
|
||||||
|
tb_zoom_level.ry = y;
|
||||||
|
tb_zoom_level.setFocusHover(pFOCUS, pHOVER);
|
||||||
|
tb_zoom_level.postBlend = _zmc;
|
||||||
|
tb_zoom_level.draw(_zmx, ovy, _zmw, _zmh, string(graph_s_to), [ mx, my ], fa_right);
|
||||||
|
|
||||||
|
draw_set_text(f_p2, fa_right, fa_top, _zmc);
|
||||||
|
if(!tb_zoom_level.selecting && !tb_zoom_level.sliding)
|
||||||
|
draw_text(_zmx - _zmw + ui(14), ovy + ui(1), "x");
|
||||||
|
#endregion
|
||||||
|
|
||||||
drawToolBar();
|
drawToolBar();
|
||||||
drawMinimap();
|
drawMinimap();
|
||||||
|
|
||||||
|
@ -219,6 +219,24 @@ function Panel_Preview() : PanelContent() constructor {
|
|||||||
show_view_control = 1;
|
show_view_control = 1;
|
||||||
|
|
||||||
resetViewOnDoubleClick = true;
|
resetViewOnDoubleClick = true;
|
||||||
|
|
||||||
|
tb_zoom_level = new textBox(TEXTBOX_INPUT.number, function(z) /*=>*/ {
|
||||||
|
var _s = canvas_s;
|
||||||
|
canvas_s = clamp(z, 0.10, 64);
|
||||||
|
|
||||||
|
if(_s != canvas_s) {
|
||||||
|
var dx = (canvas_s - _s) * ((w / 2 - canvas_x) / _s);
|
||||||
|
var dy = (canvas_s - _s) * ((h / 2 - canvas_y) / _s);
|
||||||
|
canvas_x -= dx;
|
||||||
|
canvas_y -= dy;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
tb_zoom_level.color = c_white;
|
||||||
|
tb_zoom_level.align = fa_right;
|
||||||
|
tb_zoom_level.hide = 3;
|
||||||
|
tb_zoom_level.font = f_p2;
|
||||||
|
|
||||||
|
tb_framerate = new textBox(TEXTBOX_INPUT.number, function(val) { preview_rate = real(val); });
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region ---- tool ----
|
#region ---- tool ----
|
||||||
@ -323,8 +341,6 @@ function Panel_Preview() : PanelContent() constructor {
|
|||||||
#endregion
|
#endregion
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
tb_framerate = new textBox(TEXTBOX_INPUT.number, function(val) { preview_rate = real(val); });
|
|
||||||
|
|
||||||
#region ++++ toolbars & actions ++++
|
#region ++++ toolbars & actions ++++
|
||||||
static set_tile_off = function() /*=>*/ { tileMode = 0; }
|
static set_tile_off = function() /*=>*/ { tileMode = 0; }
|
||||||
static set_tile_horizontal = function() /*=>*/ { tileMode = 1; }
|
static set_tile_horizontal = function() /*=>*/ { tileMode = 1; }
|
||||||
@ -1401,8 +1417,25 @@ function Panel_Preview() : PanelContent() constructor {
|
|||||||
|
|
||||||
if(d3_active == NODE_3D.none) {
|
if(d3_active == NODE_3D.none) {
|
||||||
right_menu_y += _lh;
|
right_menu_y += _lh;
|
||||||
draw_text(right_menu_x, right_menu_y, $"x{canvas_s}");
|
|
||||||
|
var _zms = $"x{canvas_s}";
|
||||||
|
var _zmw = string_width(_zms) + ui(16);
|
||||||
|
var _zmx = right_menu_x + ui(8);
|
||||||
|
var _zmc = tb_zoom_level.selecting || tb_zoom_level.hovering || tb_zoom_level.sliding? COLORS._main_text : COLORS._main_text_sub;
|
||||||
|
if(tb_zoom_level.hovering) mouse_on_preview = false;
|
||||||
|
|
||||||
|
tb_zoom_level.rx = x;
|
||||||
|
tb_zoom_level.ry = y;
|
||||||
|
tb_zoom_level.setFocusHover(pFOCUS, pHOVER);
|
||||||
|
tb_zoom_level.postBlend = _zmc;
|
||||||
|
tb_zoom_level.draw(_zmx, right_menu_y, _zmw, _lh, string(canvas_s), [ mx, my ], fa_right);
|
||||||
|
|
||||||
|
draw_set_text(f_p2, fa_right, fa_top, _zmc);
|
||||||
|
if(!tb_zoom_level.selecting && !tb_zoom_level.sliding)
|
||||||
|
draw_text(_zmx - _zmw + ui(14), right_menu_y + ui(1), "x");
|
||||||
|
|
||||||
|
draw_set_color(COLORS._main_text_sub);
|
||||||
|
|
||||||
if(pHOVER) {
|
if(pHOVER) {
|
||||||
right_menu_y += _lh;
|
right_menu_y += _lh;
|
||||||
var mpx = floor((mx - canvas_x) / canvas_s);
|
var mpx = floor((mx - canvas_x) / canvas_s);
|
||||||
@ -1784,7 +1817,7 @@ function Panel_Preview() : PanelContent() constructor {
|
|||||||
if(pFOCUS && WIDGET_CURRENT == noone) {
|
if(pFOCUS && WIDGET_CURRENT == noone) {
|
||||||
var _key = tool.checkHotkey();
|
var _key = tool.checkHotkey();
|
||||||
|
|
||||||
if(keyboard_check_pressed(ord(string(i + 1))) || (_key != noone && _key.isPressing()))
|
if(_key != noone && _key.isPressing())
|
||||||
tool.toggleKeyboard();
|
tool.toggleKeyboard();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1897,7 +1930,7 @@ function Panel_Preview() : PanelContent() constructor {
|
|||||||
|
|
||||||
if(pFOCUS && WIDGET_CURRENT == noone) {
|
if(pFOCUS && WIDGET_CURRENT == noone) {
|
||||||
var _key = tool.checkHotkey();
|
var _key = tool.checkHotkey();
|
||||||
if(keyboard_check_pressed(ord(string(i + 1))) || (_key != noone && _key.isPressing()))
|
if(_key != noone && _key.isPressing())
|
||||||
tool.toggleKeyboard();
|
tool.toggleKeyboard();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1906,7 +1939,7 @@ function Panel_Preview() : PanelContent() constructor {
|
|||||||
draw_sprite_stretched_ext(THEME.button_hide, 3, _x0 + pd, _y0 + pd, tool_size - pd * 2, tool_size - pd * 2, COLORS._main_accent, 1);
|
draw_sprite_stretched_ext(THEME.button_hide, 3, _x0 + pd, _y0 + pd, tool_size - pd * 2, tool_size - pd * 2, COLORS._main_accent, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(tool.subtools > 0) draw_sprite_colored(tool.spr[tool.selecting], 0, xx, yy);
|
if(tool.subtools > 0) draw_sprite_colored(tool.spr[tool.selecting], 0, xx, yy);
|
||||||
else draw_sprite_colored(tool.spr, 0, xx, yy);
|
else draw_sprite_colored(tool.spr, 0, xx, yy);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -67,8 +67,10 @@ function preview_overlay_vector(interact, active, _x, _y, _s, _mx, _my, _snx, _s
|
|||||||
__overlay_hover[0] = lerp_float(__overlay_hover[0], _index, 4);
|
__overlay_hover[0] = lerp_float(__overlay_hover[0], _index, 4);
|
||||||
draw_anchor(__overlay_hover[0], _ax, _ay, _r, _type);
|
draw_anchor(__overlay_hover[0], _ax, _ay, _r, _type);
|
||||||
|
|
||||||
draw_set_text(_f_p2b, fa_center, fa_bottom, COLORS._main_accent);
|
if(overlay_draw_text) {
|
||||||
draw_text_add(round(_ax), round(_ay - 4), name);
|
draw_set_text(_f_p2b, fa_center, fa_bottom, COLORS._main_accent);
|
||||||
|
draw_text_add(round(_ax), round(_ay - 4), name);
|
||||||
|
}
|
||||||
|
|
||||||
return hover;
|
return hover;
|
||||||
}
|
}
|
@ -66,7 +66,7 @@
|
|||||||
show_dimension : true,
|
show_dimension : true,
|
||||||
show_compute : true,
|
show_compute : true,
|
||||||
|
|
||||||
avoid_label : true,
|
avoid_label : false,
|
||||||
preview_scale : 100,
|
preview_scale : 100,
|
||||||
highlight : false,
|
highlight : false,
|
||||||
|
|
||||||
|
@ -7,6 +7,8 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor {
|
|||||||
hide = false;
|
hide = false;
|
||||||
color = COLORS._main_text;
|
color = COLORS._main_text;
|
||||||
boxColor = c_white;
|
boxColor = c_white;
|
||||||
|
postBlend = c_white;
|
||||||
|
postAlpha = 1;
|
||||||
format = TEXT_AREA_FORMAT._default;
|
format = TEXT_AREA_FORMAT._default;
|
||||||
precision = 5;
|
precision = 5;
|
||||||
padding = ui(8);
|
padding = ui(8);
|
||||||
@ -380,7 +382,7 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor {
|
|||||||
draw_text_add(_tx, _y, "."); _tx += _dt_w;
|
draw_text_add(_tx, _y, "."); _tx += _dt_w;
|
||||||
draw_text_add(_tx, _y, _dc);
|
draw_text_add(_tx, _y, _dc);
|
||||||
|
|
||||||
} else if(sliding == 2) {
|
} else if(sliding == 2 && align == fa_center) {
|
||||||
var _wh_w = string_width(_text);
|
var _wh_w = string_width(_text);
|
||||||
draw_text_add(_w / 2 - _wh_w - padding, _y, _text);
|
draw_text_add(_w / 2 - _wh_w - padding, _y, _text);
|
||||||
|
|
||||||
@ -434,7 +436,7 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor {
|
|||||||
return draw(params.x, params.y, params.w, params.h, params.data, params.m, params.halign, params.valign);
|
return draw(params.x, params.y, params.w, params.h, params.data, params.m, params.halign, params.valign);
|
||||||
}
|
}
|
||||||
|
|
||||||
static draw = function(_x, _y, _w, _h, _text = "", _m = mouse_ui, halign = fa_left, valign = fa_top) { #region
|
static draw = function(_x, _y, _w, _h, _text = "", _m = mouse_ui, halign = fa_left, valign = fa_top) {
|
||||||
x = _x;
|
x = _x;
|
||||||
y = _y;
|
y = _y;
|
||||||
w = _w;
|
w = _w;
|
||||||
@ -516,7 +518,7 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(_w > ui(48)) {
|
if(_w > ui(48)) {
|
||||||
if(sliding == 2) {
|
if(sliding == 2 && hide < 3) {
|
||||||
var _ax0 = _x + ui(10);
|
var _ax0 = _x + ui(10);
|
||||||
var _ax1 = _x + _w - ui(10);
|
var _ax1 = _x + _w - ui(10);
|
||||||
var _ay = _y + _h / 2;
|
var _ay = _y + _h / 2;
|
||||||
@ -561,14 +563,23 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sliding = 2;
|
sliding = 2;
|
||||||
slider_object = instance_create_depth(rx + _x, ry + _y, -16000, slider_Slider, { w: _w, h: _h });
|
if(hide < 3) {
|
||||||
slider_object.text = self;
|
slider_object = instance_create_depth(rx + _x, ry + _y, -16000, slider_Slider, { w: _w, h: _h });
|
||||||
|
slider_object.text = self;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var _mdx = slidePen? PEN_X_DELTA : window_mouse_get_delta_x();
|
var _mdx = slidePen? PEN_X_DELTA : window_mouse_get_delta_x();
|
||||||
var _mdy = slidePen? PEN_Y_DELTA : window_mouse_get_delta_y();
|
var _mdy = slidePen? PEN_Y_DELTA : window_mouse_get_delta_y();
|
||||||
|
|
||||||
if(sliding == 2) {
|
if(sliding == 2) {
|
||||||
|
if(slider_object) {
|
||||||
|
slider_object.x = rx + _x;
|
||||||
|
slider_object.y = ry + _y;
|
||||||
|
slider_object.w = slider_object.w;
|
||||||
|
slider_object.h = slider_object.h;
|
||||||
|
}
|
||||||
|
|
||||||
if(!slidePen && PREFERENCES.slider_lock_mouse) CURSOR_LOCK = true;
|
if(!slidePen && PREFERENCES.slider_lock_mouse) CURSOR_LOCK = true;
|
||||||
|
|
||||||
if(abs(_mdy) > abs(_mdx))
|
if(abs(_mdy) > abs(_mdx))
|
||||||
@ -741,7 +752,7 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
BLEND_ALPHA
|
BLEND_ALPHA
|
||||||
draw_surface(text_surface, tb_surf_x, tb_surf_y);
|
draw_surface_ext(text_surface, tb_surf_x, tb_surf_y, 1, 1, 0, postBlend, postAlpha);
|
||||||
BLEND_NORMAL
|
BLEND_NORMAL
|
||||||
|
|
||||||
draw_set_color(COLORS._main_text_accent);
|
draw_set_color(COLORS._main_text_accent);
|
||||||
@ -761,8 +772,8 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor {
|
|||||||
|
|
||||||
if(hover && hoverRect) {
|
if(hover && hoverRect) {
|
||||||
hovering = true;
|
hovering = true;
|
||||||
draw_sprite_stretched_ext(THEME.textbox, 1, _x, _y, _w, _h, boxColor, 0.5 + (0.5 * interactable));
|
if(hide < 3) draw_sprite_stretched_ext(THEME.textbox, 1, _x, _y, _w, _h, boxColor, 0.5 + (0.5 * interactable));
|
||||||
|
|
||||||
if(mouse_press(mb_left, active))
|
if(mouse_press(mb_left, active))
|
||||||
activate();
|
activate();
|
||||||
|
|
||||||
@ -806,9 +817,9 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor {
|
|||||||
display_text(tx - tb_surf_x, _h / 2 - th / 2, _display_text, _w - ui(4));
|
display_text(tx - tb_surf_x, _h / 2 - th / 2, _display_text, _w - ui(4));
|
||||||
surface_reset_shader();
|
surface_reset_shader();
|
||||||
}
|
}
|
||||||
|
|
||||||
BLEND_ALPHA
|
BLEND_ALPHA
|
||||||
draw_surface(text_surface, tb_surf_x, tb_surf_y);
|
draw_surface_ext(text_surface, tb_surf_x, tb_surf_y, 1, 1, 0, postBlend, postAlpha);
|
||||||
BLEND_NORMAL
|
BLEND_NORMAL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -825,7 +836,7 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor {
|
|||||||
resetFocus();
|
resetFocus();
|
||||||
sprite_index = -1;
|
sprite_index = -1;
|
||||||
return _h;
|
return _h;
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
static clone = function() {
|
static clone = function() {
|
||||||
var cln = new textBox(input, onModify);
|
var cln = new textBox(input, onModify);
|
||||||
|
42
shaders/sh_high_pass/sh_high_pass.fsh
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
varying vec2 v_vTexcoord;
|
||||||
|
varying vec4 v_vColour;
|
||||||
|
|
||||||
|
uniform vec2 dimension;
|
||||||
|
uniform int sampleMode;
|
||||||
|
uniform float radius;
|
||||||
|
uniform float intensity;
|
||||||
|
|
||||||
|
vec4 sampleTexture(vec2 pos) {
|
||||||
|
if(pos.x >= 0. && pos.y >= 0. && pos.x <= 1. && pos.y <= 1.)
|
||||||
|
return texture2D(gm_BaseTexture, pos);
|
||||||
|
|
||||||
|
if(sampleMode == 0) return vec4(0.);
|
||||||
|
else if(sampleMode == 1) return texture2D(gm_BaseTexture, clamp(pos, 0., 1.));
|
||||||
|
else if(sampleMode == 2) return texture2D(gm_BaseTexture, fract(pos));
|
||||||
|
else if(sampleMode == 3) return vec4(vec3(0.), 1.);
|
||||||
|
|
||||||
|
return vec4(0.);
|
||||||
|
}
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
vec2 tx = 1. / dimension;
|
||||||
|
vec4 ss = vec4(0.);
|
||||||
|
float ww = 0.;
|
||||||
|
|
||||||
|
for(float i = -radius; i <= radius; i++)
|
||||||
|
for(float j = -radius; j <= radius; j++) {
|
||||||
|
if(i == 0. && j == 0.) continue;
|
||||||
|
|
||||||
|
vec2 sx = v_vTexcoord + vec2(i, j) * tx;
|
||||||
|
float w = (radius - (abs(i) + abs(j)) + 1.) / radius / 4.;
|
||||||
|
if(w <= 0.) continue;
|
||||||
|
|
||||||
|
ss -= sampleTexture( sx ) * w;
|
||||||
|
ww += w;
|
||||||
|
}
|
||||||
|
|
||||||
|
vec4 sc = sampleTexture( v_vTexcoord );
|
||||||
|
ss += sc * ww;
|
||||||
|
|
||||||
|
gl_FragColor = vec4(ss.rgb * intensity, sc.a);
|
||||||
|
}
|
19
shaders/sh_high_pass/sh_high_pass.vsh
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
//
|
||||||
|
// Simple passthrough vertex shader
|
||||||
|
//
|
||||||
|
attribute vec3 in_Position; // (x,y,z)
|
||||||
|
//attribute vec3 in_Normal; // (x,y,z) unused in this shader.
|
||||||
|
attribute vec4 in_Colour; // (r,g,b,a)
|
||||||
|
attribute vec2 in_TextureCoord; // (u,v)
|
||||||
|
|
||||||
|
varying vec2 v_vTexcoord;
|
||||||
|
varying vec4 v_vColour;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
vec4 object_space_pos = vec4( in_Position.x, in_Position.y, in_Position.z, 1.0);
|
||||||
|
gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * object_space_pos;
|
||||||
|
|
||||||
|
v_vColour = in_Colour;
|
||||||
|
v_vTexcoord = in_TextureCoord;
|
||||||
|
}
|
12
shaders/sh_high_pass/sh_high_pass.yy
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"$GMShader":"",
|
||||||
|
"%Name":"sh_high_pass",
|
||||||
|
"name":"sh_high_pass",
|
||||||
|
"parent":{
|
||||||
|
"name":"blur",
|
||||||
|
"path":"folders/shader/filter/blur.yy",
|
||||||
|
},
|
||||||
|
"resourceType":"GMShader",
|
||||||
|
"resourceVersion":"2.0",
|
||||||
|
"type":1,
|
||||||
|
}
|
@ -11,6 +11,7 @@ uniform vec2 tile;
|
|||||||
uniform vec2 blend;
|
uniform vec2 blend;
|
||||||
uniform int blendUseSurf;
|
uniform int blendUseSurf;
|
||||||
uniform sampler2D blendSurf;
|
uniform sampler2D blendSurf;
|
||||||
|
uniform vec2 range;
|
||||||
|
|
||||||
#region /////////////// SAMPLING ///////////////
|
#region /////////////// SAMPLING ///////////////
|
||||||
|
|
||||||
@ -88,7 +89,8 @@ vec4 texture2Dintp( sampler2D texture, vec2 uv ) {
|
|||||||
void main() {
|
void main() {
|
||||||
vec2 center = vec2(0.5, 0.5);
|
vec2 center = vec2(0.5, 0.5);
|
||||||
vec2 coord;
|
vec2 coord;
|
||||||
vec2 _tile = swap == 1? tile.yx : tile;
|
vec2 til = tile/* * vec2(1., PI * 2.)*/;
|
||||||
|
vec2 _tile = swap == 1? til.yx : til;
|
||||||
|
|
||||||
float bld = blend.x;
|
float bld = blend.x;
|
||||||
if(blendUseSurf == 1) {
|
if(blendUseSurf == 1) {
|
||||||
@ -96,23 +98,37 @@ void main() {
|
|||||||
bld = mix(blend.x, blend.y, (_vMap.r + _vMap.g + _vMap.b) / 3.);
|
bld = mix(blend.x, blend.y, (_vMap.r + _vMap.g + _vMap.b) / 3.);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float rad0 = radians(range.x);
|
||||||
|
float rad1 = radians(range.y);
|
||||||
|
float radr = (range.y - range.x) / 360.;
|
||||||
|
|
||||||
|
gl_FragColor = vec4(0.);
|
||||||
|
|
||||||
if(invert == 0) {
|
if(invert == 0) {
|
||||||
float dist = distance(v_vTexcoord, center) / (sqrt(2.) * .5);
|
float dist = distance(v_vTexcoord, center) / (sqrt(2.) * .5);
|
||||||
if(distMode == 1) dist = sqrt(dist);
|
if(distMode == 1) dist = sqrt(dist);
|
||||||
else if(distMode == 2) dist = log(dist);
|
else if(distMode == 2) dist = log(dist);
|
||||||
|
|
||||||
vec2 cenPos = v_vTexcoord - center;
|
vec2 cenPos = v_vTexcoord - center;
|
||||||
float angle = (atan(cenPos.y, cenPos.x) / PI + 1.) / 2.;
|
float angle = atan(cenPos.y, -cenPos.x) + PI;
|
||||||
|
|
||||||
|
angle = (angle - rad0) / radr;
|
||||||
|
if(angle < rad0 || angle > rad1) return;
|
||||||
|
|
||||||
|
angle /= PI * 2.;
|
||||||
coord = fract(vec2(dist, angle) * _tile);
|
coord = fract(vec2(dist, angle) * _tile);
|
||||||
|
|
||||||
} else if(invert == 1) {
|
} else if(invert == 1) {
|
||||||
float dist = v_vTexcoord.x * 0.5;
|
float dist = v_vTexcoord.x * 0.5;
|
||||||
if(distMode == 1) dist = sqrt(dist);
|
if(distMode == 1) dist = sqrt(dist);
|
||||||
else if(distMode == 2) dist = log(dist);
|
else if(distMode == 2) dist = log(dist);
|
||||||
|
|
||||||
float ang = v_vTexcoord.y * PI * 2.;
|
float angle = v_vTexcoord.y * PI * 2.;
|
||||||
|
|
||||||
coord = fract(center + vec2(cos(ang), sin(ang)) * dist * _tile);
|
angle = (angle - rad0) / radr;
|
||||||
|
if(angle < rad0 || angle > rad1) return;
|
||||||
|
|
||||||
|
coord = fract(center + vec2(cos(angle), sin(angle)) * dist * _tile);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(swap == 1) coord.xy = coord.yx;
|
if(swap == 1) coord.xy = coord.yx;
|
||||||
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 816 B After Width: | Height: | Size: 816 B |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |