Array stuff, more gizmo, position attributes.

This commit is contained in:
MakhamDev 2022-01-17 14:52:51 +07:00
parent b93e5d0ad2
commit 904b7ccc2f
30 changed files with 446 additions and 38 deletions

View file

@ -344,6 +344,7 @@
{"id":{"name":"f_p0b","path":"fonts/f_p0b/f_p0b.yy",},"order":5,},
{"id":{"name":"o_dialog_keyframe_curve","path":"objects/o_dialog_keyframe_curve/o_dialog_keyframe_curve.yy",},"order":22,},
{"id":{"name":"s_node_text","path":"sprites/s_node_text/s_node_text.yy",},"order":22,},
{"id":{"name":"s_node_grid","path":"sprites/s_node_grid/s_node_grid.yy",},"order":119,},
{"id":{"name":"s_node_color_from_rgb","path":"sprites/s_node_color_from_rgb/s_node_color_from_rgb.yy",},"order":111,},
{"id":{"name":"s_button_middle","path":"sprites/s_button_middle/s_button_middle.yy",},"order":7,},
{"id":{"name":"node_twirl","path":"scripts/node_twirl/node_twirl.yy",},"order":30,},
@ -404,6 +405,8 @@
{"id":{"name":"sh_cell_noise_random","path":"shaders/sh_cell_noise_random/sh_cell_noise_random.yy",},"order":6,},
{"id":{"name":"s_inspector_padding","path":"sprites/s_inspector_padding/s_inspector_padding.yy",},"order":8,},
{"id":{"name":"node_normal","path":"scripts/node_normal/node_normal.yy",},"order":1,},
{"id":{"name":"s_node_lerp","path":"sprites/s_node_lerp/s_node_lerp.yy",},"order":118,},
{"id":{"name":"node_array_length","path":"scripts/node_array_length/node_array_length.yy",},"order":13,},
{"id":{"name":"s_node_solid","path":"sprites/s_node_solid/s_node_solid.yy",},"order":13,},
{"id":{"name":"node_erode","path":"scripts/node_erode/node_erode.yy",},"order":31,},
{"id":{"name":"node_wrap_mesh","path":"scripts/node_wrap_mesh/node_wrap_mesh.yy",},"order":7,},
@ -489,6 +492,7 @@
{"id":{"name":"s_node_pin_bg_active","path":"sprites/s_node_pin_bg_active/s_node_pin_bg_active.yy",},"order":9,},
{"id":{"name":"s_node_compose","path":"sprites/s_node_compose/s_node_compose.yy",},"order":101,},
{"id":{"name":"node_collection","path":"scripts/node_collection/node_collection.yy",},"order":18,},
{"id":{"name":"s_node_array_length","path":"sprites/s_node_array_length/s_node_array_length.yy",},"order":120,},
{"id":{"name":"node_value","path":"scripts/node_value/node_value.yy",},"order":6,},
{"id":{"name":"draw_line_curve","path":"scripts/draw_line_curve/draw_line_curve.yy",},"order":5,},
{"id":{"name":"s_splice_draw","path":"sprites/s_splice_draw/s_splice_draw.yy",},"order":6,},
@ -543,6 +547,7 @@
{"id":{"name":"node_channels","path":"scripts/node_channels/node_channels.yy",},"order":24,},
{"id":{"name":"node_solid","path":"scripts/node_solid/node_solid.yy",},"order":18,},
{"id":{"name":"debug","path":"scripts/debug/debug.yy",},"order":9,},
{"id":{"name":"node_lerp","path":"scripts/node_lerp/node_lerp.yy",},"order":12,},
{"id":{"name":"node_texture_remap","path":"scripts/node_texture_remap/node_texture_remap.yy",},"order":32,},
{"id":{"name":"sh_perlin_tiled","path":"shaders/sh_perlin_tiled/sh_perlin_tiled.yy",},"order":2,},
{"id":{"name":"sh_time_remap","path":"shaders/sh_time_remap/sh_time_remap.yy",},"order":33,},

View file

@ -32,10 +32,17 @@ function log_newline() {
exception_unhandled_handler(function(ex) {
var tt = "\n-------------------------- OH NO --------------------------\n\n";
tt += ex.longMessage;
tt += "\n---------------------------- :( ----------------------------\n";
tt += "\n-------------------------- STACK TRACE --------------------------\n";
for( var i = 0; i < array_length(ex.stacktrace); i++ ) {
tt += ex.stacktrace[i] + "\n";
}
tt += "\n---------------------------- :( ----------------------------\n";
log_crash(tt);
log_message("SESSION", "Ended with error");
var tt = "\n-------------------------- OH NO --------------------------\n\n";
tt += ex.longMessage;
tt += "\n---------------------------- :( ----------------------------\n";
tt += "\n\nVisit crash log from " + string(DIRECTORY + "log.txt") + " for more information";
show_error(tt, true);
return 0;

View file

@ -0,0 +1,26 @@
function Node_create_Array_Length(_x, _y) {
var node = new Node_Array_Length(_x, _y);
ds_list_add(PANEL_GRAPH.nodes_list, node);
return node;
}
function Node_Array_Length(_x, _y) : Node(_x, _y) constructor {
name = "Array Length";
previewable = false;
w = 96;
h = 32 + 24;
min_h = h;
inputs[| 0] = nodeValue(0, "Array", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, 0);
outputs[| 0] = nodeValue(0, "Size", self, JUNCTION_CONNECT.output, VALUE_TYPE.integer, 0);
function update() {
var _arr = inputs[| 0].getValue();
if(!is_array(_arr)) return;
outputs[| 0].setValue(array_length(_arr));
}
doUpdate();
}

View file

@ -0,0 +1,12 @@
{
"isDnD": false,
"isCompatibility": false,
"parent": {
"name": "number",
"path": "folders/nodes/data/number.yy",
},
"resourceVersion": "1.0",
"name": "node_array_length",
"tags": [],
"resourceType": "GMScript",
}

View file

@ -0,0 +1,12 @@
{
"isDnD": false,
"isCompatibility": false,
"parent": {
"name": "variable",
"path": "folders/nodes/data/variable.yy",
},
"resourceVersion": "1.0",
"name": "node_counter",
"tags": [],
"resourceType": "GMScript",
}

View file

@ -7,7 +7,8 @@ function Node_create_Checker(_x, _y) {
function Node_Checker(_x, _y) : Node(_x, _y) constructor {
name = "Checker";
uniform_angle = shader_get_uniform(sh_checkerboard, "angle");
uniform_pos = shader_get_uniform(sh_checkerboard, "position");
uniform_angle = shader_get_uniform(sh_checkerboard, "angle");
uniform_amount = shader_get_uniform(sh_checkerboard, "amount");
inputs[| 0] = nodeValue(0, "Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, def_surf_size2, VALUE_TAG.dimension_2d )
@ -19,12 +20,25 @@ function Node_Checker(_x, _y) : Node(_x, _y) constructor {
inputs[| 2] = nodeValue(2, "Angle", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
.setDisplay(VALUE_DISPLAY.rotation);
inputs[| 3] = nodeValue(3, "Position", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [0, 0] )
.setDisplay(VALUE_DISPLAY.vector);
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
static drawOverlay = function(_active, _x, _y, _s, _mx, _my) {
var pos = inputs[| 3].getValue();
var px = _x + pos[0] * _s;
var py = _y + pos[1] * _s;
inputs[| 3].drawOverlay(_active, _x, _y, _s, _mx, _my);
inputs[| 2].drawOverlay(_active, px, py, _s, _mx, _my);
}
function update() {
var _dim = inputs[| 0].getValue();
var _amo = inputs[| 1].getValue();
var _ang = inputs[| 2].getValue();
var _dim = inputs[| 0].getValue();
var _amo = inputs[| 1].getValue();
var _ang = inputs[| 2].getValue();
var _pos = inputs[| 3].getValue();
var _outSurf = outputs[| 0].getValue();
if(!is_surface(_outSurf)) {
@ -35,6 +49,7 @@ function Node_Checker(_x, _y) : Node(_x, _y) constructor {
surface_set_target(_outSurf);
shader_set(sh_checkerboard);
shader_set_uniform_f(uniform_pos, _pos[0] / _dim[0], _pos[1] / _dim[1]);
shader_set_uniform_f(uniform_angle, degtorad(_ang));
shader_set_uniform_f(uniform_amount, _amo);
draw_sprite_ext(s_fx_pixel, 0, 0, 0, _dim[0], _dim[1], 0, c_white, 1);

View file

@ -30,6 +30,10 @@ function Node_Grid(_x, _y) : Node(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
static drawOverlay = function(_active, _x, _y, _s, _mx, _my) {
inputs[| 1].drawOverlay(_active, _x, _y, _s, _mx, _my);
}
function update() {
var _dim = inputs[| 0].getValue();
var _pos = inputs[| 1].getValue();
@ -45,7 +49,7 @@ function Node_Grid(_x, _y) : Node(_x, _y) constructor {
surface_set_target(_outSurf);
shader_set(shader);
shader_set_uniform_f_array(uniform_pos, _pos);
shader_set_uniform_f(uniform_pos, _pos[0] / _dim[0], _pos[1] / _dim[1]);
shader_set_uniform_f_array(uniform_sca, _sca);
shader_set_uniform_f(uniform_wid, _wid);

View file

@ -0,0 +1,33 @@
function Node_create_Lerp(_x, _y) {
var node = new Node_Lerp(_x, _y);
ds_list_add(PANEL_GRAPH.nodes_list, node);
return node;
}
function Node_Lerp(_x, _y) : Node_Value_Processor(_x, _y) constructor {
name = "Lerp";
color = c_ui_cyan;
previewable = false;
w = 96;
min_h = 0;
inputs[| 0] = nodeValue(1, "a", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0);
inputs[| 1] = nodeValue(2, "b", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0);
inputs[| 2] = nodeValue(3, "Progress", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
.setDisplay(VALUE_DISPLAY.slider_range, [0, 1, .01]);
outputs[| 0] = nodeValue(0, "Result", self, JUNCTION_CONNECT.output, VALUE_TYPE.float, 0);
function process_value_data(_data, index = 0) {
return lerp(_data[0], _data[1], _data[2]);
}
function onDrawNode(xx, yy, _mx, _my, _s) {
draw_set_text(f_h5, fa_center, fa_center, c_white);
var str = "lerp";
var _ss = min((w - 8) * _s / string_width(str), (h - 8) * _s / string_height(str));
draw_text_transformed(xx + w / 2 * _s, yy + 10 + h / 2 * _s, str, _ss, _ss, 0);
}
}

View file

@ -0,0 +1,12 @@
{
"isDnD": false,
"isCompatibility": false,
"parent": {
"name": "number",
"path": "folders/nodes/data/number.yy",
},
"resourceVersion": "1.0",
"name": "node_lerp",
"tags": [],
"resourceType": "GMScript",
}

View file

@ -30,6 +30,10 @@ function Node_Noise_Aniso(_x, _y) : Node(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
static drawOverlay = function(_active, _x, _y, _s, _mx, _my) {
inputs[| 3].drawOverlay(_active, _x, _y, _s, _mx, _my);
}
function update() {
var _dim = inputs[| 0].getValue();
var _amo = inputs[| 1].getValue();
@ -46,7 +50,7 @@ function Node_Noise_Aniso(_x, _y) : Node(_x, _y) constructor {
surface_set_target(_outSurf);
shader_set(shader);
shader_set_uniform_f_array(uniform_noi, _amo);
shader_set_uniform_f_array(uniform_pos, _pos);
shader_set_uniform_f(uniform_pos, _pos[0] / _dim[0], _pos[1] / _dim[1]);
shader_set_uniform_f(uniform_sed, _sed);
draw_sprite_ext(s_fx_pixel, 0, 0, 0, _dim[0], _dim[1], 0, c_white, 1);

View file

@ -34,6 +34,10 @@ function Node_Grid_Noise(_x, _y) : Node(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
static drawOverlay = function(_active, _x, _y, _s, _mx, _my) {
inputs[| 1].drawOverlay(_active, _x, _y, _s, _mx, _my);
}
function update() {
var _dim = inputs[| 0].getValue();
var _pos = inputs[| 1].getValue();

View file

@ -110,6 +110,7 @@ function NodeObject(_name, _spr, _create, tags = []) constructor {
addNodeObject(filter, "2D light", s_node_2d_light, "Node_2D_light", Node_create_2D_light);
addNodeObject(filter, "Atlas", s_node_atlas, "Node_Atlas", Node_create_Atlas);
addNodeObject(filter, "Scale algorithm", s_node_scale_algo, "Node_Scale_Algo", Node_create_Scale_Algo, ["Scale2x", "Scale3x"]);
addNodeObject(filter, "Pixel cloud", s_node_pixel_cloud, "Node_Pixel_Cloud", Node_create_Pixel_Cloud);
//addNodeObject(filter, "Corner", s_node_corner, "Node_Corner", Node_create_Corner);
var threeD = ds_list_create();
@ -125,17 +126,18 @@ function NodeObject(_name, _spr, _create, tags = []) constructor {
var number = ds_list_create();
addNodeCatagory("Number", number);
addNodeObject(number, "Math", s_node_math, "Node_Math", Node_create_Math);
//addNodeObject(number, "Array", s_node_array, "Node_Array", Node_create_Array);
addNodeObject(number, "Number", s_node_number, "Node_Number", Node_create_Number);
addNodeObject(number, "Vector2", s_node_vec2, "Node_Vector2", Node_create_Vector2);
addNodeObject(number, "Vector3", s_node_vec3, "Node_Vector3", Node_create_Vector3);
addNodeObject(number, "Vector4", s_node_vec4, "Node_Vector4", Node_create_Vector4);
addNodeObject(number, "Vector split", s_node_vec_split, "Node_Vector_Split",Node_create_Vector_Split);
addNodeObject(number, "Unicode", s_node_unicode, "Node_Unicode", Node_create_Unicode);
addNodeObject(number, "Path", s_node_path, "Node_Path", Node_create_Path);
addNodeObject(number, "Area", s_node_area, "Node_Area", Node_create_Area);
addNodeObject(number, "Surface data", s_node_surface_data,"Node_Surface_data",Node_create_Surface_data);
addNodeObject(number, "Math", s_node_math, "Node_Math", Node_create_Math);
//addNodeObject(number, "Array", s_node_array, "Node_Array", Node_create_Array);
addNodeObject(number, "Array length", s_node_array_length, "Node_Array_Length", Node_create_Array_Length);
addNodeObject(number, "Number", s_node_number, "Node_Number", Node_create_Number);
addNodeObject(number, "Vector2", s_node_vec2, "Node_Vector2", Node_create_Vector2);
addNodeObject(number, "Vector3", s_node_vec3, "Node_Vector3", Node_create_Vector3);
addNodeObject(number, "Vector4", s_node_vec4, "Node_Vector4", Node_create_Vector4);
addNodeObject(number, "Vector split", s_node_vec_split, "Node_Vector_Split", Node_create_Vector_Split);
addNodeObject(number, "Unicode", s_node_unicode, "Node_Unicode", Node_create_Unicode);
addNodeObject(number, "Path", s_node_path, "Node_Path", Node_create_Path);
addNodeObject(number, "Area", s_node_area, "Node_Area", Node_create_Area);
addNodeObject(number, "Surface data", s_node_surface_data, "Node_Surface_data", Node_create_Surface_data);
var color = ds_list_create();
addNodeCatagory("Color", color);
@ -168,11 +170,10 @@ function NodeObject(_name, _spr, _create, tags = []) constructor {
addNodeObject(generator, "Perlin noise", s_node_noise_perlin, "Node_Perlin", Node_create_Perlin);
addNodeObject(generator, "Cellular noise", s_node_noise_cell, "Node_Cellular", Node_create_Cellular);
addNodeObject(generator, "Grid noise", s_node_grid_noise, "Node_Grid_Noise", Node_create_Grid_Noise);
addNodeObject(generator, "Grid", s_node_grid_noise, "Node_Grid", Node_create_Grid);
addNodeObject(generator, "Grid", s_node_grid, "Node_Grid", Node_create_Grid);
addNodeObject(generator, "Anisotropic noise", s_node_noise_aniso, "Node_Noise_Aniso", Node_create_Noise_Aniso);
addNodeObject(generator, "Seperate shape", s_node_sepearte_shape, "Node_Seperate_Shape", Node_create_Seperate_Shape);
addNodeObject(generator, "Text", s_node_text, "Node_Text", Node_create_Text);
addNodeObject(generator, "Pixel cloud", s_node_pixel_cloud, "Node_Pixel_Cloud", Node_create_Pixel_Cloud);
var render = ds_list_create();
addNodeCatagory("Render", render);

View file

@ -7,9 +7,10 @@ function Node_create_Stripe(_x, _y) {
function Node_Stripe(_x, _y) : Node(_x, _y) constructor {
name = "Stripe";
uniform_angle = shader_get_uniform(sh_stripe, "angle");
uniform_pos = shader_get_uniform(sh_stripe, "position");
uniform_angle = shader_get_uniform(sh_stripe, "angle");
uniform_amount = shader_get_uniform(sh_stripe, "amount");
uniform_blend = shader_get_uniform(sh_stripe, "blend");
uniform_blend = shader_get_uniform(sh_stripe, "blend");
inputs[| 0] = nodeValue(0, "Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, def_surf_size2, VALUE_TAG.dimension_2d )
.setDisplay(VALUE_DISPLAY.vector);
@ -22,13 +23,26 @@ function Node_Stripe(_x, _y) : Node(_x, _y) constructor {
inputs[| 3] = nodeValue(3, "Blend", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, 0);
inputs[| 4] = nodeValue(4, "Position", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [0, 0] )
.setDisplay(VALUE_DISPLAY.vector);
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
static drawOverlay = function(_active, _x, _y, _s, _mx, _my) {
var pos = inputs[| 4].getValue();
var px = _x + pos[0] * _s;
var py = _y + pos[1] * _s;
inputs[| 4].drawOverlay(_active, _x, _y, _s, _mx, _my);
inputs[| 2].drawOverlay(_active, px, py, _s, _mx, _my);
}
function update() {
var _dim = inputs[| 0].getValue();
var _amo = inputs[| 1].getValue();
var _ang = inputs[| 2].getValue();
var _bnd = inputs[| 3].getValue();
var _dim = inputs[| 0].getValue();
var _amo = inputs[| 1].getValue();
var _ang = inputs[| 2].getValue();
var _bnd = inputs[| 3].getValue();
var _pos = inputs[| 4].getValue();
var _outSurf = outputs[| 0].getValue();
if(!is_surface(_outSurf)) {
@ -39,6 +53,7 @@ function Node_Stripe(_x, _y) : Node(_x, _y) constructor {
surface_set_target(_outSurf);
shader_set(sh_stripe);
shader_set_uniform_f(uniform_pos, _pos[0] / _dim[0], _pos[1] / _dim[1]);
shader_set_uniform_f(uniform_angle, degtorad(_ang));
shader_set_uniform_f(uniform_amount, _amo);
shader_set_uniform_f(uniform_blend, _bnd);

View file

@ -7,6 +7,7 @@ function Node_create_Zigzag(_x, _y) {
function Node_Zigzag(_x, _y) : Node(_x, _y) constructor {
name = "Zigzag";
uniform_pos = shader_get_uniform(sh_zigzag, "position");
uniform_amount = shader_get_uniform(sh_zigzag, "amount");
inputs[| 0] = nodeValue(0, "Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, def_surf_size2, VALUE_TAG.dimension_2d )
@ -14,12 +15,20 @@ function Node_Zigzag(_x, _y) : Node(_x, _y) constructor {
inputs[| 1] = nodeValue(1, "Amount", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 1)
.setDisplay(VALUE_DISPLAY.slider, [1, 32, 1]);
inputs[| 2] = nodeValue(2, "Position", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [0, 0] )
.setDisplay(VALUE_DISPLAY.vector);
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
static drawOverlay = function(_active, _x, _y, _s, _mx, _my) {
inputs[| 2].drawOverlay(_active, _x, _y, _s, _mx, _my);
}
function update() {
var _dim = inputs[| 0].getValue();
var _amo = inputs[| 1].getValue();
var _dim = inputs[| 0].getValue();
var _amo = inputs[| 1].getValue();
var _pos = inputs[| 2].getValue();
var _outSurf = outputs[| 0].getValue();
if(!is_surface(_outSurf)) {
@ -30,6 +39,7 @@ function Node_Zigzag(_x, _y) : Node(_x, _y) constructor {
surface_set_target(_outSurf);
shader_set(sh_zigzag);
shader_set_uniform_f(uniform_pos, _pos[0] / _dim[0], _pos[1] / _dim[1]);
shader_set_uniform_f(uniform_amount, _amo);
draw_sprite_ext(s_fx_pixel, 0, 0, 0, _dim[0], _dim[1], 0, c_white, 1);
shader_reset();

View file

@ -239,7 +239,13 @@ function textBox(_input, _onModify) constructor {
sliding = 2;
if(sliding == 2) {
_input_text = slide_sx + dx * slide_speed;
var spd = dx * slide_speed;
if(keyboard_check(vk_alt))
spd /= 10;
if(keyboard_check(vk_control))
spd *= 10;
_input_text = slide_sx + spd;
switch(input) {
case TEXTBOX_INPUT.number :

View file

@ -13,7 +13,7 @@ float random (in vec2 st) {
}
void main() {
vec2 _pos = position + v_vTexcoord;
vec2 _pos = v_vTexcoord - position;
float yy = floor(_pos.y * noiseAmount.y);
float xx = (_pos.x + random(vec2(yy))) * noiseAmount.x;
float x0 = floor(xx);

View file

@ -4,11 +4,12 @@
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
uniform vec2 position;
uniform float angle;
uniform float amount;
void main() {
vec2 c = v_vTexcoord - vec2(0.5);
vec2 c = v_vTexcoord - position;
float _x = .5 + c.x * cos(angle) - c.y * sin(angle);
float _y = .5 + c.x * sin(angle) + c.y * cos(angle);
float _a = 1. / amount;

View file

@ -9,7 +9,7 @@ uniform vec2 scale;
uniform float width;
void main() {
vec2 _pos = v_vTexcoord + position;
vec2 _pos = v_vTexcoord - position;
vec2 dist = _pos - floor(_pos * scale) / scale;
float ww = width / 2.;

View file

@ -14,7 +14,7 @@ float random (in vec2 st) {
}
void main() {
vec2 st = v_vTexcoord + position;
vec2 st = v_vTexcoord - position;
vec2 pos = vec2(st * scale);
pos.x += random(vec2(0., floor(pos.y))) * shift;
vec2 i = floor(pos);

View file

@ -4,12 +4,14 @@
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
uniform vec2 position;
uniform float angle;
uniform float amount;
uniform int blend;
void main() {
float prog = .5 + (v_vTexcoord.x - .5) * cos(angle) - (v_vTexcoord.y - .5) * sin(angle);
vec2 pos = v_vTexcoord - position;
float prog = pos.x * cos(angle) - pos.y * sin(angle);
float _a = 1. / amount;
float _s = mod(prog, _a);

View file

@ -4,16 +4,18 @@
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
uniform vec2 position;
uniform float amount;
void main() {
vec2 pos = v_vTexcoord - position;
float _cell = 1. / (amount * 2.);
float _xind = floor(v_vTexcoord.x / _cell);
float _yind = floor(v_vTexcoord.y / _cell);
float _xind = floor(pos.x / _cell);
float _yind = floor(pos.y / _cell);
float _xcell = mod(v_vTexcoord.x, _cell);
float _ycell = mod(v_vTexcoord.y, _cell);
float _xcell = mod(pos.x, _cell);
float _ycell = mod(pos.y, _cell);
float _x = _xcell;
float _y = _ycell;

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

View file

@ -0,0 +1,79 @@
{
"bboxMode": 0,
"collisionKind": 1,
"type": 0,
"origin": 4,
"preMultiplyAlpha": false,
"edgeFiltering": false,
"collisionTolerance": 0,
"swfPrecision": 2.525,
"bbox_left": 2,
"bbox_right": 29,
"bbox_top": 6,
"bbox_bottom": 26,
"HTile": false,
"VTile": false,
"For3D": false,
"width": 32,
"height": 32,
"textureGroupId": {
"name": "Default",
"path": "texturegroups/Default",
},
"swatchColours": null,
"gridX": 0,
"gridY": 0,
"frames": [
{"compositeImage":{"FrameId":{"name":"43876625-3678-43e2-893e-59f2dda6d267","path":"sprites/s_node_array_length/s_node_array_length.yy",},"LayerId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMSpriteBitmap",},"images":[
{"FrameId":{"name":"43876625-3678-43e2-893e-59f2dda6d267","path":"sprites/s_node_array_length/s_node_array_length.yy",},"LayerId":{"name":"2234cc37-178e-4eb3-9cfd-e5243cb715e1","path":"sprites/s_node_array_length/s_node_array_length.yy",},"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMSpriteBitmap",},
],"parent":{"name":"s_node_array_length","path":"sprites/s_node_array_length/s_node_array_length.yy",},"resourceVersion":"1.0","name":"43876625-3678-43e2-893e-59f2dda6d267","tags":[],"resourceType":"GMSpriteFrame",},
],
"sequence": {
"spriteId": {"name":"s_node_array_length","path":"sprites/s_node_array_length/s_node_array_length.yy",},
"timeUnits": 1,
"playback": 1,
"playbackSpeed": 30.0,
"playbackSpeedType": 0,
"autoRecord": true,
"volume": 1.0,
"length": 1.0,
"events": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore<MessageEventKeyframe>",},
"moments": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore<MomentsEventKeyframe>",},
"tracks": [
{"name":"frames","spriteId":null,"keyframes":{"Keyframes":[
{"id":"f8cb50d4-64ce-40ce-ac4d-aef3ff910028","Key":0.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"43876625-3678-43e2-893e-59f2dda6d267","path":"sprites/s_node_array_length/s_node_array_length.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe<SpriteFrameKeyframe>",},
],"resourceVersion":"1.0","resourceType":"KeyframeStore<SpriteFrameKeyframe>",},"trackColour":0,"inheritsTrackColour":true,"builtinName":0,"traits":0,"interpolation":1,"tracks":[],"events":[],"isCreationTrack":false,"resourceVersion":"1.0","tags":[],"resourceType":"GMSpriteFramesTrack","modifiers":[],},
],
"visibleRange": {"x":0.0,"y":0.0,},
"lockOrigin": false,
"showBackdrop": true,
"showBackdropImage": false,
"backdropImagePath": "",
"backdropImageOpacity": 0.5,
"backdropWidth": 1366,
"backdropHeight": 768,
"backdropXOffset": 0.0,
"backdropYOffset": 0.0,
"xorigin": 16,
"yorigin": 16,
"eventToFunction": {},
"eventStubScript": null,
"parent": {"name":"s_node_array_length","path":"sprites/s_node_array_length/s_node_array_length.yy",},
"resourceVersion": "1.3",
"name": "s_node_array_length",
"tags": [],
"resourceType": "GMSequence",
},
"layers": [
{"visible":true,"isLocked":false,"blendMode":0,"opacity":100.0,"displayName":"default","resourceVersion":"1.0","name":"2234cc37-178e-4eb3-9cfd-e5243cb715e1","tags":[],"resourceType":"GMImageLayer",},
],
"nineSlice": null,
"parent": {
"name": "icons",
"path": "folders/nodes/icons.yy",
},
"resourceVersion": "1.0",
"name": "s_node_array_length",
"tags": [],
"resourceType": "GMSprite",
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 B

View file

@ -0,0 +1,79 @@
{
"bboxMode": 0,
"collisionKind": 1,
"type": 0,
"origin": 4,
"preMultiplyAlpha": false,
"edgeFiltering": false,
"collisionTolerance": 0,
"swfPrecision": 2.525,
"bbox_left": 2,
"bbox_right": 29,
"bbox_top": 2,
"bbox_bottom": 30,
"HTile": false,
"VTile": false,
"For3D": false,
"width": 32,
"height": 32,
"textureGroupId": {
"name": "Default",
"path": "texturegroups/Default",
},
"swatchColours": null,
"gridX": 0,
"gridY": 0,
"frames": [
{"compositeImage":{"FrameId":{"name":"8b598738-8571-41d1-8a88-5f96963a0ff0","path":"sprites/s_node_grid/s_node_grid.yy",},"LayerId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMSpriteBitmap",},"images":[
{"FrameId":{"name":"8b598738-8571-41d1-8a88-5f96963a0ff0","path":"sprites/s_node_grid/s_node_grid.yy",},"LayerId":{"name":"0437d486-f16a-42a4-b114-8ce77e85f242","path":"sprites/s_node_grid/s_node_grid.yy",},"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMSpriteBitmap",},
],"parent":{"name":"s_node_grid","path":"sprites/s_node_grid/s_node_grid.yy",},"resourceVersion":"1.0","name":"8b598738-8571-41d1-8a88-5f96963a0ff0","tags":[],"resourceType":"GMSpriteFrame",},
],
"sequence": {
"spriteId": {"name":"s_node_grid","path":"sprites/s_node_grid/s_node_grid.yy",},
"timeUnits": 1,
"playback": 1,
"playbackSpeed": 30.0,
"playbackSpeedType": 0,
"autoRecord": true,
"volume": 1.0,
"length": 1.0,
"events": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore<MessageEventKeyframe>",},
"moments": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore<MomentsEventKeyframe>",},
"tracks": [
{"name":"frames","spriteId":null,"keyframes":{"Keyframes":[
{"id":"3f3d3ab3-6fed-4742-9154-27b028e6cf26","Key":0.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"8b598738-8571-41d1-8a88-5f96963a0ff0","path":"sprites/s_node_grid/s_node_grid.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe<SpriteFrameKeyframe>",},
],"resourceVersion":"1.0","resourceType":"KeyframeStore<SpriteFrameKeyframe>",},"trackColour":0,"inheritsTrackColour":true,"builtinName":0,"traits":0,"interpolation":1,"tracks":[],"events":[],"isCreationTrack":false,"resourceVersion":"1.0","tags":[],"resourceType":"GMSpriteFramesTrack","modifiers":[],},
],
"visibleRange": {"x":0.0,"y":0.0,},
"lockOrigin": false,
"showBackdrop": true,
"showBackdropImage": false,
"backdropImagePath": "",
"backdropImageOpacity": 0.5,
"backdropWidth": 1366,
"backdropHeight": 768,
"backdropXOffset": 0.0,
"backdropYOffset": 0.0,
"xorigin": 16,
"yorigin": 16,
"eventToFunction": {},
"eventStubScript": null,
"parent": {"name":"s_node_grid","path":"sprites/s_node_grid/s_node_grid.yy",},
"resourceVersion": "1.3",
"name": "s_node_grid",
"tags": [],
"resourceType": "GMSequence",
},
"layers": [
{"visible":true,"isLocked":false,"blendMode":0,"opacity":100.0,"displayName":"default","resourceVersion":"1.0","name":"0437d486-f16a-42a4-b114-8ce77e85f242","tags":[],"resourceType":"GMImageLayer",},
],
"nineSlice": null,
"parent": {
"name": "icons",
"path": "folders/nodes/icons.yy",
},
"resourceVersion": "1.0",
"name": "s_node_grid",
"tags": [],
"resourceType": "GMSprite",
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 B

View file

@ -0,0 +1,79 @@
{
"bboxMode": 0,
"collisionKind": 1,
"type": 0,
"origin": 4,
"preMultiplyAlpha": false,
"edgeFiltering": false,
"collisionTolerance": 0,
"swfPrecision": 2.525,
"bbox_left": 1,
"bbox_right": 30,
"bbox_top": 12,
"bbox_bottom": 20,
"HTile": false,
"VTile": false,
"For3D": false,
"width": 32,
"height": 32,
"textureGroupId": {
"name": "Default",
"path": "texturegroups/Default",
},
"swatchColours": null,
"gridX": 0,
"gridY": 0,
"frames": [
{"compositeImage":{"FrameId":{"name":"84b3be0a-c8e0-41e1-a927-3d603ca0b519","path":"sprites/s_node_lerp/s_node_lerp.yy",},"LayerId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMSpriteBitmap",},"images":[
{"FrameId":{"name":"84b3be0a-c8e0-41e1-a927-3d603ca0b519","path":"sprites/s_node_lerp/s_node_lerp.yy",},"LayerId":{"name":"752a7efe-e330-48b4-a04b-65ea0abe9f81","path":"sprites/s_node_lerp/s_node_lerp.yy",},"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMSpriteBitmap",},
],"parent":{"name":"s_node_lerp","path":"sprites/s_node_lerp/s_node_lerp.yy",},"resourceVersion":"1.0","name":"84b3be0a-c8e0-41e1-a927-3d603ca0b519","tags":[],"resourceType":"GMSpriteFrame",},
],
"sequence": {
"spriteId": {"name":"s_node_lerp","path":"sprites/s_node_lerp/s_node_lerp.yy",},
"timeUnits": 1,
"playback": 1,
"playbackSpeed": 30.0,
"playbackSpeedType": 0,
"autoRecord": true,
"volume": 1.0,
"length": 1.0,
"events": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore<MessageEventKeyframe>",},
"moments": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore<MomentsEventKeyframe>",},
"tracks": [
{"name":"frames","spriteId":null,"keyframes":{"Keyframes":[
{"id":"1352e346-7193-4926-81e7-aa8ba84edc5f","Key":0.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"84b3be0a-c8e0-41e1-a927-3d603ca0b519","path":"sprites/s_node_lerp/s_node_lerp.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe<SpriteFrameKeyframe>",},
],"resourceVersion":"1.0","resourceType":"KeyframeStore<SpriteFrameKeyframe>",},"trackColour":0,"inheritsTrackColour":true,"builtinName":0,"traits":0,"interpolation":1,"tracks":[],"events":[],"isCreationTrack":false,"resourceVersion":"1.0","tags":[],"resourceType":"GMSpriteFramesTrack","modifiers":[],},
],
"visibleRange": {"x":0.0,"y":0.0,},
"lockOrigin": false,
"showBackdrop": true,
"showBackdropImage": false,
"backdropImagePath": "",
"backdropImageOpacity": 0.5,
"backdropWidth": 1366,
"backdropHeight": 768,
"backdropXOffset": 0.0,
"backdropYOffset": 0.0,
"xorigin": 16,
"yorigin": 16,
"eventToFunction": {},
"eventStubScript": null,
"parent": {"name":"s_node_lerp","path":"sprites/s_node_lerp/s_node_lerp.yy",},
"resourceVersion": "1.3",
"name": "s_node_lerp",
"tags": [],
"resourceType": "GMSequence",
},
"layers": [
{"visible":true,"isLocked":false,"blendMode":0,"opacity":100.0,"displayName":"default","resourceVersion":"1.0","name":"752a7efe-e330-48b4-a04b-65ea0abe9f81","tags":[],"resourceType":"GMImageLayer",},
],
"nineSlice": null,
"parent": {
"name": "icons",
"path": "folders/nodes/icons.yy",
},
"resourceVersion": "1.0",
"name": "s_node_lerp",
"tags": [],
"resourceType": "GMSprite",
}