localize, array rearange, stagger, slide cancle, canvas

This commit is contained in:
Tanasart 2024-01-16 15:56:20 +07:00
parent e7b70c9abc
commit 78bf7ca154
71 changed files with 32834 additions and 28255 deletions

View file

@ -782,6 +782,7 @@
{"name":"ac_disappear","order":2,"path":"animcurves/ac_disappear/ac_disappear.yy",},
{"name":"s_node_path_array","order":11,"path":"sprites/s_node_path_array/s_node_path_array.yy",},
{"name":"node_display_image","order":4,"path":"scripts/node_display_image/node_display_image.yy",},
{"name":"s_node_array_rearrange","order":19,"path":"sprites/s_node_array_rearrange/s_node_array_rearrange.yy",},
{"name":"s_node_pytagorean_tile","order":38,"path":"sprites/s_node_pytagorean_tile/s_node_pytagorean_tile.yy",},
{"name":"node_rigid_global","order":5,"path":"scripts/node_rigid_global/node_rigid_global.yy",},
{"name":"sh_rsh_erode","order":2,"path":"shaders/sh_rsh_erode/sh_rsh_erode.yy",},
@ -965,6 +966,7 @@
{"name":"FirebaseREST_HTTP_Success_Firestore","order":19,"path":"scripts/FirebaseREST_HTTP_Success_Firestore/FirebaseREST_HTTP_Success_Firestore.yy",},
{"name":"s_node_pb_draw_rectangle","order":13,"path":"sprites/s_node_pb_draw_rectangle/s_node_pb_draw_rectangle.yy",},
{"name":"panel_animation","order":1,"path":"scripts/panel_animation/panel_animation.yy",},
{"name":"node_array_rearrange","order":19,"path":"scripts/node_array_rearrange/node_array_rearrange.yy",},
{"name":"sh_pb_to_mask","order":7,"path":"shaders/sh_pb_to_mask/sh_pb_to_mask.yy",},
{"name":"d3d_gizmo_plane","order":5,"path":"scripts/d3d_gizmo_plane/d3d_gizmo_plane.yy",},
{"name":"node_surface_replace","order":11,"path":"scripts/node_surface_replace/node_surface_replace.yy",},
@ -987,6 +989,7 @@
{"name":"Obj_FirebaseFirestore_Collection_Query_options_value_path","order":12,"path":"objects/Obj_FirebaseFirestore_Collection_Query_options_value_path/Obj_FirebaseFirestore_Collection_Query_options_value_path.yy",},
{"name":"sh_posterize","order":19,"path":"shaders/sh_posterize/sh_posterize.yy",},
{"name":"s_node_mirror","order":3,"path":"sprites/s_node_mirror/s_node_mirror.yy",},
{"name":"s_node_stagger","order":6,"path":"sprites/s_node_stagger/s_node_stagger.yy",},
{"name":"s_node_blur_simple","order":43,"path":"sprites/s_node_blur_simple/s_node_blur_simple.yy",},
{"name":"theme_definition","order":14,"path":"scripts/theme_definition/theme_definition.yy",},
{"name":"project_data","order":17,"path":"scripts/project_data/project_data.yy",},

View file

@ -327,6 +327,7 @@
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"UI.json","CopyToMask":-1,"filePath":"datafiles/data/Locale/en",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"words.json","CopyToMask":-1,"filePath":"datafiles/data/locale/en",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"words.json","CopyToMask":-1,"filePath":"datafiles/data/Locale/en",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"LOCALIZATION GUIDES.txt","CopyToMask":-1,"filePath":"datafiles/data/Locale",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"config.json","CopyToMask":-1,"filePath":"datafiles/data/locale/sample locale",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"config.json","CopyToMask":-1,"filePath":"datafiles/data/Locale/sample locale",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"FiraCode-Medium.ttf","CopyToMask":-1,"filePath":"datafiles/data/locale/sample locale/fonts",},
@ -339,8 +340,6 @@
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"NotoSans-Medium.ttf","CopyToMask":-1,"filePath":"datafiles/data/Locale/sample locale/fonts",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"NotoSans-SemiBold.ttf","CopyToMask":-1,"filePath":"datafiles/data/locale/sample locale/fonts",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"NotoSans-SemiBold.ttf","CopyToMask":-1,"filePath":"datafiles/data/Locale/sample locale/fonts",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"HOW TO LOCALE.txt","CopyToMask":-1,"filePath":"datafiles/data/locale/sample locale",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"HOW TO LOCALE.txt","CopyToMask":-1,"filePath":"datafiles/data/Locale/sample locale",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"nodes.json","CopyToMask":-1,"filePath":"datafiles/data/locale/sample locale",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"nodes.json","CopyToMask":-1,"filePath":"datafiles/data/Locale/sample locale",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"UI.json","CopyToMask":-1,"filePath":"datafiles/data/locale/sample locale",},
@ -1046,6 +1045,7 @@
{"id":{"name":"ac_disappear","path":"animcurves/ac_disappear/ac_disappear.yy",},},
{"id":{"name":"s_node_path_array","path":"sprites/s_node_path_array/s_node_path_array.yy",},},
{"id":{"name":"node_display_image","path":"scripts/node_display_image/node_display_image.yy",},},
{"id":{"name":"s_node_array_rearrange","path":"sprites/s_node_array_rearrange/s_node_array_rearrange.yy",},},
{"id":{"name":"s_node_pytagorean_tile","path":"sprites/s_node_pytagorean_tile/s_node_pytagorean_tile.yy",},},
{"id":{"name":"node_rigid_global","path":"scripts/node_rigid_global/node_rigid_global.yy",},},
{"id":{"name":"sh_rsh_erode","path":"shaders/sh_rsh_erode/sh_rsh_erode.yy",},},
@ -1257,6 +1257,7 @@
{"id":{"name":"node_surface_from_color","path":"scripts/node_surface_from_color/node_surface_from_color.yy",},},
{"id":{"name":"s_node_pb_draw_rectangle","path":"sprites/s_node_pb_draw_rectangle/s_node_pb_draw_rectangle.yy",},},
{"id":{"name":"panel_animation","path":"scripts/panel_animation/panel_animation.yy",},},
{"id":{"name":"node_array_rearrange","path":"scripts/node_array_rearrange/node_array_rearrange.yy",},},
{"id":{"name":"sh_pb_to_mask","path":"shaders/sh_pb_to_mask/sh_pb_to_mask.yy",},},
{"id":{"name":"d3d_gizmo_plane","path":"scripts/d3d_gizmo_plane/d3d_gizmo_plane.yy",},},
{"id":{"name":"node_surface_replace","path":"scripts/node_surface_replace/node_surface_replace.yy",},},
@ -1281,6 +1282,7 @@
{"id":{"name":"sh_posterize","path":"shaders/sh_posterize/sh_posterize.yy",},},
{"id":{"name":"s_node_mirror","path":"sprites/s_node_mirror/s_node_mirror.yy",},},
{"id":{"name":"draw_enable_alphablend","path":"scripts/draw_enable_alphablend/draw_enable_alphablend.yy",},},
{"id":{"name":"s_node_stagger","path":"sprites/s_node_stagger/s_node_stagger.yy",},},
{"id":{"name":"s_node_blur_simple","path":"sprites/s_node_blur_simple/s_node_blur_simple.yy",},},
{"id":{"name":"theme_definition","path":"scripts/theme_definition/theme_definition.yy",},},
{"id":{"name":"project_data","path":"scripts/project_data/project_data.yy",},},

View file

@ -0,0 +1,7 @@
You can find sample locale folder in the `installation folder/data/locale/sample locale` (For Steam user you can right click > Properties > Installed File > Browse...).
- nodes.json, UI.json, words.json is for translation.
- If your language use non-ascii characters (or character not included in the default font Noto Sans), you need to supply your own font files in the fonts folder.
- Copy font files (.ttf, .otf) to the fonts folder (You can delete the existed fonts in that folder).
- Edit `fonts/fonts.json` such that each "path" value point to the font file.
- If your language does not use space to separate words, you need to edit `config.json` and set "per_character_line_break" to true.

Binary file not shown.

File diff suppressed because it is too large Load diff

View file

@ -343,5 +343,9 @@
"supporter": "Supporter",
"supporter_exclusive": "Supporter exclusive",
"external": "External",
"mk_effects": "MK Effects",
"flip_fluid": "FLIP Fluid",
"" : ""
}

View file

@ -1,5 +0,0 @@
1. nodes.json, UI.json, words.json is for translation.
2. If your language use non-ascii characters (or character not included in the default font), you need to supply your own font files in the fonts folder.
2.1. Copy font files (.ttf, .otf) to fonts/
2.2. Edit fonts/fonts.json such that each "path" value point to the font file.
2.3. If your language does not use space to separate words, you need to edit config.json and set "per_character_line_break" to true.

View file

@ -1,8 +1,12 @@
{
"h1": {
"path": "./NotoSans-Medium.ttf",
"path": "./NotoSans-Bold.ttf",
"size": 48
},
"h2": {
"path": "./NotoSans-Bold.ttf",
"size": 32
},
"h3": {
"path": "./NotoSans-Bold.ttf",
"size": 20
@ -33,6 +37,16 @@
},
"code": {
"path": "./FiraCode-Medium.ttf",
"size": 12
"size": 10
},
"sdf": {
"path": "./NotoSans-Bold.ttf",
"size": 32,
"sdf": true
},
"sdf_medium": {
"path": "./NotoSans-Medium.ttf",
"size": 22,
"sdf": true
}
}

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load diff

View file

@ -343,5 +343,9 @@
"supporter": "Supporter",
"supporter_exclusive": "Supporter exclusive",
"external": "External",
"mk_effects": "MK Effects",
"flip_fluid": "FLIP Fluid",
"" : ""
}

View file

@ -1,5 +0,0 @@
1. nodes.json, UI.json, words.json is for translation.
2. If your language use non-ascii characters (or character not included in the default font), you need to supply your own font files in the fonts folder.
2.1. Copy font files (.ttf, .otf) to fonts/
2.2. Edit fonts/fonts.json such that each "path" value point to the font file.
2.3. If your language does not use space to separate words, you need to edit config.json and set "per_character_line_break" to true.

View file

@ -1,8 +1,12 @@
{
"h1": {
"path": "./NotoSans-Medium.ttf",
"path": "./NotoSans-Bold.ttf",
"size": 48
},
"h2": {
"path": "./NotoSans-Bold.ttf",
"size": 32
},
"h3": {
"path": "./NotoSans-Bold.ttf",
"size": 20
@ -33,6 +37,16 @@
},
"code": {
"path": "./FiraCode-Medium.ttf",
"size": 12
"size": 10
},
"sdf": {
"path": "./NotoSans-Bold.ttf",
"size": 32,
"sdf": true
},
"sdf_medium": {
"path": "./NotoSans-Medium.ttf",
"size": 22,
"sdf": true
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

View file

@ -1,5 +1,5 @@
/// @description Insert description here
FLIP_cleanDomain(domain);
buffer_delete(particlePosBuff);
if(particlePosBuff >= 0) buffer_delete(particlePosBuff);
domain = noone;

View file

@ -98,7 +98,23 @@ event_inherited();
preset_selecting = i;
click_block = true;
}
}
}
if(isHover) {
if(i >= 0 && mouse_press(mb_right, interactable && sFOCUS)) {
hovering = pal;
menuCall("palette_window_preset_menu",,, [
menuItem(__txtx("palette_editor_set_default", "Set as default"), function() {
DEF_PALETTE = array_clone(hovering.palette);
}),
menuItem(__txtx("palette_editor_delete", "Delete palette"), function() {
file_delete(hovering.path);
__initPalette();
}),
]);
}
}
yy += _height + ui(4);
hh += _height + ui(4);

View file

@ -11,7 +11,7 @@ if !ready exit;
}
doDrag();
if(sFOCUS) {
if(sFOCUS && WIDGET_CURRENT == noone) {
if(keyboard_check_pressed(vk_enter)) {
onApply(selector.current_color);
instance_destroy();

View file

@ -26,7 +26,7 @@ event_inherited();
setColor = function(color) {
if(key_selecting == noone) return;
key_selecting.value = color;
key_selecting.value = int64(color);
onApply(gradient);
}
@ -216,6 +216,22 @@ event_inherited();
}
}
if(isHover) {
if(i >= 0 && mouse_press(mb_right, interactable && sFOCUS)) {
hovering = pal;
menuCall("palette_window_preset_menu",,, [
menuItem(__txtx("palette_editor_set_default", "Set as default"), function() {
DEF_PALETTE = array_clone(hovering.palette);
}),
menuItem(__txtx("palette_editor_delete", "Delete palette"), function() {
file_delete(hovering.path);
__initPalette();
}),
]);
}
}
yy += _height + ui(4);
hh += _height + ui(4);
}

View file

@ -10,7 +10,7 @@ if !ready exit;
}
doDrag();
if(sFOCUS) {
if(sFOCUS && WIDGET_CURRENT == noone) {
if(keyboard_check_pressed(vk_enter)) {
onApply(gradient);
instance_destroy();

View file

@ -96,13 +96,14 @@ event_inherited();
}
if(i >= 0 && mouse_press(mb_right, interactable && sFOCUS)) {
hovering_name = pal.path;
hovering = pal;
menuCall("palette_window_preset_menu",,, [
menuItem(__txtx("palette_editor_delete", "Delete palette"), function() {
file_delete(hovering_name);
file_delete(hovering.path);
__initPalette();
})
])
}),
]);
}
}

View file

@ -11,7 +11,7 @@ if !ready exit;
doDrag();
}
if(sFOCUS) {
if(sFOCUS && WIDGET_CURRENT == noone) {
if(keyboard_check_pressed(vk_enter)) {
onApply(palette);
instance_destroy();

View file

@ -13,11 +13,11 @@ draw_clear(COLORS.bg);
#region widget scroll
if(!WIDGET_TAB_BLOCK) {
if(keyboard_check_pressed(vk_tab) && key_mod_press(SHIFT))
widget_previous();
else if(keyboard_check_pressed(vk_tab))
widget_next();
if(keyboard_check_pressed(vk_tab) && key_mod_press(SHIFT)) {
if(key_mod_press(SHIFT)) widget_previous();
else widget_next();
}
if(keyboard_check_pressed(vk_enter))
widget_trigger();

View file

@ -11,4 +11,7 @@ drag_sy += dy;
var _dirr = point_direction(drag_cx, drag_cy, drag_sx, drag_sy);
delta = angle_difference(_dirr, drag_sa);
delta_acc += delta;
drag_sa = _dirr;
drag_sa = _dirr;
FOCUS = noone;
HOVER = noone;

View file

@ -1,4 +1,7 @@
/// @description Insert description here
var dx = mouse_mx - drag_mx;
drag_mx = mouse_mx;
drag_sx += dx;
drag_sx += dx;
FOCUS = self;
HOVER = self;

View file

@ -2,6 +2,7 @@
depth = -19999;
tb = noone;
val = 0;
tb_de = 0;
function activate() {
slide_da = -1;

View file

@ -5,7 +5,7 @@ if(slide_da == -1) {
var _dist = point_distance(slide_dx, slide_dy, mouse_mx, mouse_my);
var _dirr = point_direction(slide_dx, slide_dy, mouse_mx, mouse_my);
if(_dist > 16) {
if(_dist > 8) {
if(_dirr < 45) slide_da = 0;
else if(_dirr < 135) slide_da = 1;
else if(_dirr < 225) slide_da = 0;
@ -17,6 +17,19 @@ if(slide_da == -1) {
exit;
}
tb_de = 1;
if(mouse_press(mb_right)) {
tb._input_text = string_real(tb.slide_sv);
tb.apply();
tb.sliding = false;
tb.deactivate();
UNDO_HOLDING = false;
tb = noone;
exit;
}
var _s = tb.slide_speed;
if(!MOUSE_WRAPPING) {
@ -29,6 +42,7 @@ if(!MOUSE_WRAPPING) {
var spd = (slide_da? _ady : _adx) * _s;
val = value_snap(tb.slide_sv + spd, _s);
if(tb.slide_int) val = round(val);
var _stp_sz = 50 * _s;
var _stp_fl = round(val / _stp_sz) * _stp_sz;

View file

@ -0,0 +1,6 @@
/// @description Insert description here
if(tb_de) {
FOCUS = self;
HOVER = self;
tb_de--;
}

View file

@ -5,6 +5,7 @@
"eventList": [
{"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,},
{"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,},
{"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":0,"eventType":3,"isDnD":false,},
],
"managed": true,
"overriddenProperties": [],

View file

@ -118,7 +118,7 @@ function colorSelector(onApply = noone) constructor {
sat = round(color_get_saturation(current_color));
val = round(color_get_value(current_color));
if(_apply && onApply != noone) onApply(current_color);
if(_apply && onApply != noone) onApply(int64(current_color));
}
function setHSV(_apply = true) {
@ -126,7 +126,7 @@ function colorSelector(onApply = noone) constructor {
var alp = color_get_alpha(current_color);
current_color = make_color_hsva(hue, sat, val, alp);
if(_apply && onApply != noone) onApply(current_color);
if(_apply && onApply != noone) onApply(int64(current_color));
}
function setColor(color, _apply = true) {
@ -137,7 +137,7 @@ function colorSelector(onApply = noone) constructor {
function colorPicker() {
if(!dropper_active) return;
dropper_color = draw_getpixel(mouse_mx, mouse_my);
dropper_color = int64(cola(draw_getpixel(mouse_mx, mouse_my)));
}
static drawDropper = function(instance) {

View file

@ -6,9 +6,11 @@ function curveBox(_onModify) : widget() constructor {
node_drag_typ = -1;
zoom_level = 1;
zoom_level_to = 1;
zoom_min = 1;
zoom_max = 3;
zooming = false;
zoom_min = 1;
zoom_max = 3;
zooming = false;
show_coord = false;
miny = 0;
maxy = 1;
@ -61,6 +63,8 @@ function curveBox(_onModify) : widget() constructor {
curve_surface = surface_verify(curve_surface, cw, _h);
if(node_dragging != -1) { #region editing
show_coord = true;
if(node_drag_typ == 0) {
var node_point = (node_dragging - 2) / 6;
if(node_point > 0 && node_point < points - 1) {
@ -299,6 +303,8 @@ function curveBox(_onModify) : widget() constructor {
#endregion
if(hover && point_in_rectangle(_m[0], _m[1], _x, _y, _x + cw, _y + _h)) { #region
show_coord = true;
if(mouse_press(mb_left, active)) {
if(node_hovering == -1) {
var _ind = point_insert * 6;
@ -331,14 +337,21 @@ function curveBox(_onModify) : widget() constructor {
if(node_hovering == -1 && mouse_press(mb_right, active)) {
menuCall("widget_curve", rx + _m[0], ry + _m[1], [
menuItemGroup(__txt("Presets"), [
[ [THEME.curve_presets, 0], function() { onModify(CURVE_DEF_00); } ],
[ [THEME.curve_presets, 1], function() { onModify(CURVE_DEF_11); } ],
[ [THEME.curve_presets, 2], function() { onModify(CURVE_DEF_01); } ],
[ [THEME.curve_presets, 3], function() { onModify(CURVE_DEF_10); } ],
]),
-1,
menuItem(grid_show? __txt("Hide grid") : __txt("Show grid"), function() { grid_show = !grid_show; }),
menuItem(__txt("Snap to grid"), function() { grid_snap = !grid_snap; },,, function() { return grid_snap } ),
menuItemGroup("Grid size", [
menuItemGroup(__txt("Grid size"), [
[ "1%", function() { grid_step = 0.01; } ],
[ "5%", function() { grid_step = 0.05; } ],
[ "10%", function() { grid_step = 0.10; } ],
[ "25%", function() { grid_step = 0.25; } ],
])
]),
]);
}
} #endregion
@ -347,16 +360,18 @@ function curveBox(_onModify) : widget() constructor {
draw_set_color(COLORS.widget_curve_outline);
draw_rectangle(_x, _y, _x + cw, _y + _h, true);
var tx = _x + cw - ui(6);
var ty = _y + _h - ui(6);
draw_set_text(f_p2, fa_right, fa_bottom, display_sel? COLORS._main_text: COLORS._main_text_sub);
draw_text_add(tx, ty, $"{display_sel == 2? "dy" : "y"}: {string_format(display_pos_y * 100, -1, 2)}%");
ty -= line_get_height();
draw_text_add(tx, ty, $"{display_sel == 2? "dx" : "x"}: {string_format(display_pos_x * 100, -1, 2)}%");
if(show_coord) {
var tx = _x + cw - ui(6);
var ty = _y + _h - ui(6);
draw_set_text(f_p2, fa_right, fa_bottom, display_sel? COLORS._main_text: COLORS._main_text_sub);
draw_text_add(tx, ty, $"{display_sel == 2? "dy" : "y"}: {string_format(display_pos_y * 100, -1, 2)}%");
ty -= line_get_height();
draw_text_add(tx, ty, $"{display_sel == 2? "dx" : "x"}: {string_format(display_pos_x * 100, -1, 2)}%");
}
show_coord = false;
resetFocus();
return h;

View file

@ -1,5 +1,7 @@
//curve format [-cx0, -cy0, x0, y0, +cx0, +cy0, -cx1, -cy1, x1, y1, +cx1, +cy1]
//segment format [y0, +cx0, +cy0, -cx1, -cy1, y1];
//segment format [y0, +cx0, +cy0, -cx1, -cy1, y1]
#macro CURVE_DEF_00 [0, 0, 0, 0, 1/3, 0, /**/ -1/3, 0, 1, 0, 0, 0]
#macro CURVE_DEF_01 [0, 0, 0, 0, 1/3, 1/3, /**/ -1/3, -1/3, 1, 1, 0, 0]
#macro CURVE_DEF_10 [0, 0, 0, 1, 1/3, -1/3, /**/ -1/3, 1/3, 1, 0, 0, 0]
#macro CURVE_DEF_11 [0, 0, 0, 1, 1/3, 0, /**/ -1/3, 0, 1, 1, 0, 0]

View file

@ -1,23 +1,25 @@
globalvar FONT_DEF, FONT_ISLOADED, FONT_CACHE, GLYPH_MAP;
globalvar FONT_DEF, FONT_ISLOADED, FONT_CACHE, FONT_CUST_CACHE, GLYPH_MAP;
globalvar f_h1, f_h2, f_h3, f_h5, f_p0, f_p0b, f_p1, f_p2, f_p3, f_code, f_sdf, f_sdf_medium;
FONT_DEF = true;
FONT_CACHE = {};
FONT_ISLOADED = false;
GLYPH_MAP = {};
FONT_DEF = true;
FONT_CACHE = {};
FONT_CUST_CACHE = {};
FONT_ISLOADED = false;
GLYPH_MAP = {};
function _font_add(path, size, sdf = false) { #region
function _font_add(path, size, sdf = false, custom = false) { #region
var _cache = custom? FONT_CUST_CACHE : FONT_CACHE;
var font_cache_dir = DIRECTORY + "font_cache";
directory_verify(font_cache_dir);
var _key = $"{filename_name_only(path)}_{size}_{sdf}";
if(struct_has(FONT_CACHE, _key) && font_exists(FONT_CACHE[$ _key]))
return FONT_CACHE[$ _key];
if(struct_has(_cache, _key) && font_exists(_cache[$ _key]))
return _cache[$ _key];
var _t = current_time;
var _f = font_add(path, size, false, false, 0, 0);
if(sdf) font_enable_sdf(_f, true);
FONT_CACHE[$ _key] = _f;
_cache[$ _key] = _f;
_font_extend_locale(_f, _f);

View file

@ -25,10 +25,10 @@
globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER, LATEST_VERSION;
LATEST_VERSION = 11600;
VERSION = 11630;
SAVE_VERSION = 11630;
VERSION_STRING = "1.16.3.0";
BUILD_NUMBER = 11630;
VERSION = 11640;
SAVE_VERSION = 11640;
VERSION_STRING = "1.16.4.0";
BUILD_NUMBER = 11640;
globalvar APPEND_MAP;
APPEND_MAP = ds_map_create();

View file

@ -8,15 +8,15 @@ function gradientKey(time, value) constructor { #region
self.time = time;
self.value = value;
static clone = function() { return new gradientKey(time, value); }
static clone = function() { return new gradientKey(time, value); }
static serialize = function() { return { time, value }; }
} #endregion
function gradientObject(color = c_black) constructor { #region
static GRADIENT_LIMIT = 128;
if(is_array(color)) keys = [ new gradientKey(0, color[0]), new gradientKey(1, color[1]) ];
else keys = [ new gradientKey(0, color) ];
if(is_array(color)) keys = [ new gradientKey(0, cola(color[0])), new gradientKey(1, cola(color[1])) ];
else keys = [ new gradientKey(0, cola(color)) ];
type = GRADIENT_INTER.smooth;
surf = noone;
@ -234,12 +234,13 @@ function gradientObject(color = c_black) constructor { #region
return self;
}
type = struct_try_get(s, "type");
keys = array_create(array_length(s.keys));
for( var i = 0, n = array_length(s.keys); i < n; i++ ) {
var _time = real(s.keys[i].time);
var _value = real(s.keys[i].value);
_value = PROJECT.version < 11640 && !is_int64(_value)? cola(_value) : int64(_value);
keys[i] = new gradientKey(_time, _value);
}

View file

@ -12,10 +12,12 @@
var root = $"{DIRECTORY}Locale";
directory_verify(root);
if(check_version($"{root}/version"))
if(check_version($"{root}/version")) {
zip_unzip(lfile, root);
file_copy($"data/Locale/LOCALIZATION GUIDES.txt", $"{DIRECTORY}Locale/LOCALIZATION GUIDES.txt");
}
if(LOCALE_DEF) return;
if(LOCALE_DEF && !TEST_LOCALE) return;
loadLocale();
} #endregion
@ -40,9 +42,8 @@
function __txtx(key, def = "") { #region
INLINE
if(LOCALE_DEF) return def;
if(LOCALE_DEF && !TEST_LOCALE) return def;
if(key == "") return "";
if(TEST_LOCALE) {
if(!struct_has(LOCALE.word, key) && !struct_has(LOCALE.ui, key)) {
show_debug_message($"LOCALE: \"{key}\": \"{def}\",");
@ -60,9 +61,8 @@
function __txt(txt, prefix = "") { #region
INLINE
if(LOCALE_DEF) return txt;
if(LOCALE_DEF && !TEST_LOCALE) return txt;
if(txt == "") return "";
var key = string_lower(txt);
key = string_replace_all(key, " ", "_");
@ -88,7 +88,7 @@
function __txt_node_name(node, def = "") { #region
INLINE
if(LOCALE_DEF) return def;
if(LOCALE_DEF && !TEST_LOCALE) return def;
if(TEST_LOCALE) {
if(!struct_has(LOCALE.node, node)) {
@ -107,7 +107,7 @@
function __txt_node_tooltip(node, def = "") { #region
INLINE
if(LOCALE_DEF) return def;
if(LOCALE_DEF && !TEST_LOCALE) return def;
if(TEST_LOCALE) {
if(!struct_has(LOCALE.node, node)) {
@ -126,7 +126,7 @@
function __txt_junction_name(node, type, index, def = "") { #region
INLINE
if(LOCALE_DEF) return def;
if(LOCALE_DEF && !TEST_LOCALE) return def;
if(TEST_LOCALE) {
if(!struct_has(LOCALE.node, node)) {
@ -149,7 +149,7 @@
function __txt_junction_tooltip(node, type, index, def = "") { #region
INLINE
if(LOCALE_DEF) return def;
if(LOCALE_DEF && !TEST_LOCALE) return def;
if(TEST_LOCALE) {
if(!struct_has(LOCALE.node, node)) {
@ -172,7 +172,7 @@
function __txt_junction_data(node, type, index, def = []) { #region
INLINE
if(LOCALE_DEF) return def;
if(LOCALE_DEF && !TEST_LOCALE) return def;
if(TEST_LOCALE) {
if(!struct_has(LOCALE.node, node)) {

View file

@ -0,0 +1,143 @@
function Node_Array_Rearrange(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
name = "Array Rearrange";
inputs[| 0] = nodeValue("Array", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, 0)
.setArrayDepth(1)
.setVisible(true, true);
inputs[| 1] = nodeValue("Orders", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [])
.setArrayDepth(1);
outputs[| 0] = nodeValue("Array", self, JUNCTION_CONNECT.output, VALUE_TYPE.any, 0)
.setArrayDepth(1);
type = VALUE_TYPE.any;
ordering = noone;
order_i = noone;
order_y = 0;
rearranger = new Inspector_Custom_Renderer(function(_x, _y, _w, _m, _hover, _focus) { #region
var _arr = inputs[| 0].getValue();
var _ord = inputs[| 1].getValue();
var amo = array_length(_arr);
var _fx = _x;
var _fy = _y + ui(8);
var _fh = inputs[| 0].type == VALUE_TYPE.surface? ui(48) : ui(32);
var _fsh = _fh - ui(8);
var _h = amo * (_fh + ui(4));
var _hov = 0;
for( var i = 0; i < amo; i++ ) {
var _ind = _ord[i];
var _val = _arr[_ind];
_fx = _x;
if(order_i == _ind) _fx += ui(16) * order_y;
var _ffx = _fx + ui(32 + 4);
var _ffy = _fy + ui(4);
draw_sprite_stretched_ext(THEME.timeline_node, 0, _fx, _fy, _w, _fh, CDEF.main_dkblack, 1);
var hv = ordering == noone && _hover && point_in_rectangle(_m[0], _m[1], _fx, _fy, _fx + ui(32), _fy + _fh);
var cc = hv? COLORS._main_icon : COLORS.node_composite_bg;
draw_sprite_ext(THEME.hamburger_s, 0, _fx + ui(16), _fy + _fh / 2, 1, 1, 0, cc, 1);
if(_m[1] > _ffy) _hov = i;
switch(inputs[| 0].type) {
case VALUE_TYPE.surface :
var _sw = surface_get_width_safe(_val);
var _sh = surface_get_height_safe(_val);
var _ss = min( _fsh / _sw, _fsh / _sh );
_sw *= _ss;
_sh *= _ss;
var _sx = _ffx + _fsh / 2 - _sw / 2;
var _sy = _ffy + _fsh / 2 - _sh / 2;
draw_sprite_stretched_ext(THEME.timeline_node, 0, _ffx, _ffy, _fsh, _fsh, merge_color(COLORS._main_icon_dark, COLORS.node_composite_bg, 0.25), 1);
draw_surface_ext_safe(_val, _sx, _sy, _ss, _ss);
draw_set_color(COLORS.node_composite_bg);
break;
default :
draw_set_text(f_p2, fa_left, fa_center, COLORS._main_text);
draw_text(_ffx, _ffy + _fsh / 2, string(_val));
break;
}
if(hv && mouse_press(mb_left, _focus)) {
ordering = _ind;
order_i = _ind;
}
_fy += _fh + ui(4);
}
if(ordering != noone) {
order_y = lerp_float(order_y, 1, 5);
array_remove(_ord, ordering);
array_insert(_ord, _hov, ordering);
inputs[| 1].setValue(_ord);
if(mouse_release(mb_left))
ordering = noone;
} else
order_y = lerp_float(order_y, 0, 5);
return _h;
}); #endregion
input_display_list = [ 0, ["Rearranger", false], rearranger ];
static onValueFromUpdate = function(index = 0) {
if(LOADING || APPENDING) return;
var _arr = inputs[| 0].getValue();
var _val = array_create(array_length(_arr));
for( var i = 0, n = array_length(_arr); i < n; i++ )
_val[i] = i;
inputs[| 1].setValue(_val);
}
static step = function() {
var _typ = VALUE_TYPE.any;
if(inputs[| 0].value_from != noone) _typ = inputs[| 0].value_from.type;
inputs[| 0].setType(_typ);
outputs[| 0].setType(_typ);
if(type != _typ) {
if(_typ == VALUE_TYPE.surface) {
w = 128;
h = 128;
min_h = h;
} else {
w = 96;
h = 32 + 24;
min_h = h;
}
type = _typ;
will_setHeight = true;
}
}
static update = function(frame = CURRENT_FRAME) {
var _arr = getInputData(0);
var _ord = getInputData(1);
if(!is_array(_arr)) return;
var res = [];
for( var i = 0; i < array_length(_arr); i++ ) {
var _ind = array_safe_get(_ord, i, i);
res[i] = array_safe_get(_arr, _ind);
}
outputs[| 0].setValue(res);
}
}

View file

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

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

@ -156,8 +156,7 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
input_display_list = [
["Output", false], 0, frame_renderer, 12, 13,
["Brush", false], 6, 2, 1, 15, 17, 16,
["Fill", false], 3, 4,
["Brush", false], 6, 15, 17, 16,
["Background", true, 10], 8, 14, 9,
];
@ -218,24 +217,102 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
brush_seed = irandom_range(100000, 999999);
brush_next_dist = 0;
tool_channel_edit = new checkBoxGroup(THEME.tools_canvas_channel, function(ind, val) { tool_attribute.channel[ind] = val; });
tool_attribute.color = cola(c_white);
tool_attribute.channel = [ true, true, true, true ];
tool_settings = [
[ "Channel", tool_channel_edit, "channel", tool_attribute ],
];
tool_channel_edit = new checkBoxGroup(THEME.tools_canvas_channel, function(ind, val) { tool_attribute.channel[ind] = val; });
tool_settings = [ [ "Channel", tool_channel_edit, "channel", tool_attribute ] ];
tool_attribute.size = 1;
tool_size_edit = new textBox(TEXTBOX_INPUT.number, function(val) { tool_attribute.size = round(val); }).setSlidable(0.1, true);
tool_size_edit.font = f_p3;
tool_size = [ "Size", tool_size_edit, "size", tool_attribute ];
tool_attribute.thres = 0;
tool_thrs_edit = new textBox(TEXTBOX_INPUT.number, function(val) { tool_attribute.thres = clamp(val, 0, 1); }).setSlidable(0.01);
tool_thrs_edit.font = f_p3;
tool_thrs = [ "Threshold", tool_thrs_edit, "thres", tool_attribute ];
tool_attribute.fill8 = false;
tool_fil8_edit = new checkBox(function() { tool_attribute.fill8 = !tool_attribute.fill8; });
tool_fil8 = [ "Diagonal", tool_fil8_edit, "fill8", tool_attribute ];
tools = [
new NodeTool( "Selection", [ THEME.canvas_tools_selection_rectangle, THEME.canvas_tools_selection_circle ]),
new NodeTool( "Pencil", THEME.canvas_tools_pencil),
new NodeTool( "Eraser", THEME.canvas_tools_eraser),
new NodeTool( "Rectangle", [ THEME.canvas_tools_rect, THEME.canvas_tools_rect_fill ]),
new NodeTool( "Ellipse", [ THEME.canvas_tools_ellip, THEME.canvas_tools_ellip_fill ]),
new NodeTool( "Fill", THEME.canvas_tools_bucket),
new NodeTool( "Pencil", THEME.canvas_tools_pencil)
.setSetting(tool_size),
new NodeTool( "Eraser", THEME.canvas_tools_eraser)
.setSetting(tool_size),
new NodeTool( "Rectangle", [ THEME.canvas_tools_rect, THEME.canvas_tools_rect_fill ])
.setSetting(tool_size),
new NodeTool( "Ellipse", [ THEME.canvas_tools_ellip, THEME.canvas_tools_ellip_fill ])
.setSetting(tool_size),
new NodeTool( "Fill", THEME.canvas_tools_bucket)
.setSetting(tool_thrs)
.setSetting(tool_fil8),
];
draw_stack = ds_list_create();
#endregion
function setToolColor(color) { tool_attribute.color = color; }
static drawTools = function(_mx, _my, xx, yy, tool_size, hover, focus) { #region
var _sx0 = xx - tool_size / 2;
var _sx1 = xx + tool_size / 2;
var hh = ui(8);
yy += ui(4);
draw_set_color(COLORS._main_icon_dark);
draw_line_round(_sx0 + ui(8), yy, _sx1 - ui(8), yy, 2);
yy += ui(4);
var _cx = _sx0 + ui(8);
var _cw = tool_size - ui(16);
var _ch = ui(12);
var _pd = ui(5);
yy += ui(8);
hh += ui(8);
drawColor(tool_attribute.color, _cx, yy, _cw, _cw);
draw_sprite_stretched_ext(THEME.palette_selecting, 0, _cx - _pd, yy - _pd, _cw + _pd * 2, _cw + _pd * 2, c_white, 1);
if(point_in_rectangle(_mx, _my, _cx, yy, _cx + _cw, yy + _ch) && mouse_press(mb_left, focus)) {
var dialog = dialogCall(o_dialog_color_selector);
dialog.selector.onApply = setToolColor;
dialog.onApply = setToolColor;
dialog.setDefault(tool_attribute.color);
}
yy += _cw + ui(8);
hh += _cw + ui(8);
for( var i = 0, n = array_length(DEF_PALETTE); i < n; i++ ) {
var _c = DEF_PALETTE[i];
var ii = 0;
if(i == 0) ii = 4;
if(i == n - 1) ii = 5;
draw_sprite_stretched_ext(THEME.palette_mask, ii, _cx, yy, _cw, _ch, _c, 1);
if(hover && point_in_rectangle(_mx, _my, _cx, yy, _cx + _cw, yy + _ch)) {
if(mouse_click(mb_left, focus))
tool_attribute.color = _c;
}
yy += _ch;
hh += _ch;
}
return hh + ui(4);
} #endregion
function removeFrame(index = 0) { #region
if(attributes.frames <= 1) return;
@ -341,7 +418,7 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
} #endregion
function apply_draw_surface() { #region
var _alp = _color_get_alpha(getInputData(1));
var _alp = _color_get_alpha(tool_attribute.color);
storeAction();
@ -526,12 +603,13 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
} #endregion
function flood_fill_scanline(_x, _y, _surf, _thres, _corner = false) { #region
var _alp = _color_get_alpha(getInputData(1));
var colorFill = draw_get_color() + (255 << 24);
var colorBase = get_color_buffer(_x, _y);
if(colorFill == colorBase) return;
if(colorFill == colorBase) return; //Clicking on the same color as the fill color
var _alp = _color_get_alpha(tool_attribute.color);
draw_set_alpha(_alp);
var x1, y1, x_start;
var spanAbove, spanBelow;
@ -546,78 +624,59 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
y1 = pos[1];
var colorCurr = get_color_buffer(x1, y1);
//print("Searching " + string(x1) + ", " + string(y1) + ": " + string(colorCurr));
//print($"Searching {x1}, {y1}: {colorCurr}");
if(colorCurr == colorFill) continue; //Color in queue already filled
if(colorCurr == colorFill) continue; //Color in queue is already filled
while(x1 >= 0 && ff_fillable(colorBase, colorFill, x1, y1, thr)) //Shift left
while(x1 > 0 && ff_fillable(colorBase, colorFill, x1 - 1, y1, thr)) //Move to the leftmost connected pixel in the same row.
x1--;
x1++;
x_start = x1;
spanAbove = false;
spanBelow = false;
while(x1 < surface_w && ff_fillable(colorBase, colorFill, x1, y1, thr)) {
draw_set_alpha(_alp);
draw_point(x1, y1);
draw_set_alpha(1);
var _cbuffer = canvas_buffer[preview_index];
buffer_seek(_cbuffer, buffer_seek_start, (surface_w * y1 + x1) * 4);
buffer_write(_cbuffer, buffer_u32, colorFill);
//print("> Filling " + string(x1) + ", " + string(y1) + ": " + string(get_color_buffer(x1, y1)));
//print($"> Filling {x1}, {y1}: {get_color_buffer(x1, y1)}");
if(y1 > 0) {
if(x1 == x_start && x1 > 0 && _corner) {
if(!spanAbove && ff_fillable(colorBase, colorFill, x1 - 1, y1 - 1, thr)) {
ds_queue_enqueue(queue, [x1 - 1, y1 - 1]);
spanAbove = true;
}
}
if(_corner && x1 > 0 && ff_fillable(colorBase, colorFill, x1 - 1, y1 - 1, thr)) //Check top left pixel
ds_queue_enqueue(queue, [x1 - 1, y1 - 1]);
if(ff_fillable(colorBase, colorFill, x1, y1 - 1, thr)) {
if(ff_fillable(colorBase, colorFill, x1, y1 - 1, thr)) //Check top pixel
ds_queue_enqueue(queue, [x1, y1 - 1]);
}
}
if(y1 < surface_h - 1) {
if(x1 == x_start && x1 > 0 && _corner) {
if(!spanBelow && ff_fillable(colorBase, colorFill, x1 - 1, y1 + 1, thr)) {
ds_queue_enqueue(queue, [x1 - 1, y1 + 1]);
spanBelow = true;
}
}
if(_corner && x1 > 0 && ff_fillable(colorBase, colorFill, x1 - 1, y1 + 1, thr)) //Check bottom left pixel
ds_queue_enqueue(queue, [x1 - 1, y1 + 1]);
if(ff_fillable(colorBase, colorFill, x1, y1 + 1, thr)) {
if(ff_fillable(colorBase, colorFill, x1, y1 + 1, thr)) //Check bottom pixel
ds_queue_enqueue(queue, [x1, y1 + 1]);
}
}
if(_corner && x1 < surface_w - 1) {
if(y1 > 0 && ff_fillable(colorBase, colorFill, x1 + 1, y1 - 1, thr)) //Check top right pixel
ds_queue_enqueue(queue, [x1 + 1, y1 - 1]);
if(y1 < surface_h - 1 && ff_fillable(colorBase, colorFill, x1 + 1, y1 + 1, thr)) //Check bottom right pixel
ds_queue_enqueue(queue, [x1 + 1, y1 + 1]);
}
x1++;
}
if(x1 < surface_w - 1 && _corner) {
if(y1 > 0) {
if(!spanAbove && ff_fillable(colorBase, colorFill, x1 + 1, y1 - 1, thr)) {
ds_queue_enqueue(queue, [x1 + 1, y1 - 1]);
spanAbove = true;
}
}
if(y1 < surface_h - 1) {
if(!spanBelow && ff_fillable(colorBase, colorFill, x1 + 1, y1 + 1, thr)) {
ds_queue_enqueue(queue, [x1 + 1, y1 + 1]);
spanBelow = true;
}
}
}
}
}
draw_set_alpha(1);
} #endregion
function canvas_fill(_x, _y, _surf, _thres) { #region
var _alp = _color_get_alpha(getInputData(1));
var _alp = _color_get_alpha(tool_attribute.color);
var w = surface_get_width_safe(_surf);
var h = surface_get_height_safe(_surf);
@ -648,10 +707,11 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
mouse_cur_y = round((_my - _y) / _s - 0.5);
var _dim = attributes.dimension;
var _col = getInputData(1);
var _siz = getInputData(2);
var _thr = getInputData(3);
var _fill_type = getInputData(4);
var _col = tool_attribute.color;
var _siz = tool_attribute.size;
var _thr = tool_attribute.thres;
var _fill_type = tool_attribute.fill8;
var _prev = getInputData(5);
var _brushSurf = getInputData(6);
var _brushDist = getInputData(15);
@ -975,7 +1035,7 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
var _bg = getInputData(8);
var _bga = getInputData(9);
var _bgr = getInputData(10);
var _alp = _color_get_alpha(getInputData(1));
var _alp = _color_get_alpha(_col);
var __s = surface_get_target();
@ -1023,7 +1083,7 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
}
surface_reset_shader();
if(isUsingTool()) {
if(active && isUsingTool()) {
if(isUsingTool("Selection")) {
if(is_selected) {
var pos_x = _x + selection_position[0] * _s;
@ -1063,6 +1123,7 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
draw_rectangle(_x0, _y0, _x1 - 1, _y1 - 1, true);
previewing = 1;
draw_set_alpha(1);
} #endregion
static step = function() { #region

View file

@ -5,7 +5,7 @@ function Node_Crop_Content(_x, _y, _group = noone) : Node(_x, _y, _group) constr
inputs[| 1] = nodeValue("Active", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true);
inputs[| 2] = nodeValue("Array", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 1, "Cropping mode for dealing with image array.")
inputs[| 2] = nodeValue("Array Sizing", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 1, "Cropping mode for dealing with image array.")
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Largest, same size", "Independent" ]);
inputs[| 3] = nodeValue("Padding", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [ 0, 0, 0, 0 ], "Add padding back after crop.")

View file

@ -1741,6 +1741,8 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
isTool = true;
} #endregion
static drawTools = function(_mx, _my, xx, yy, tool_size, hover, focus) { return 0; }
static serialize = function(scale = false, preset = false) { #region
if(!active) return;

View file

@ -671,6 +671,12 @@ function valueAnimator(_val, _prop, _sep_axis = false) constructor {
} else if(prop.type == VALUE_TYPE.gradient) {
var grad = new gradientObject();
_val = grad.deserialize(value);
} else if(prop.type == VALUE_TYPE.color) {
if(is_array(_val)) {
for( var i = 0, n = array_length(_val); i < n; i++ )
_val[i] = PROJECT.version < 11640 && !is_int64(_val[i])? cola(_val[i]) : int64(_val[i]);
} else
_val = PROJECT.version < 11640 && !is_int64(_val)? cola(_val) : int64(_val);
} else if(!sep_axis && typeArray(prop.display_type)) {
_val = [];
@ -681,7 +687,7 @@ function valueAnimator(_val, _prop, _sep_axis = false) constructor {
for(var j = 0; j < array_length(base); j++)
_val[j] = processValue(value);
}
}
}
//print($"Deserialize {prop.node.name}:{prop.name} = {_val} ");
var vk = new valueKey(_time, _val, self, ease_in, ease_out);

View file

@ -321,22 +321,10 @@ function Node_MK_Fall(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
var _p1 = _pos[1];
var _p2 = _pos[2];
var _dr0 = point_direction(_p1[0], _p1[1], _p0[0], _p0[1]);
var _dr2 = point_direction(_p1[0], _p1[1], _p2[0], _p2[1]);
var _sc = random_range_seed(_scale[0], _scale[1], _sed + 20);
var _sx = _size[0] * _sc;
var _sy = _size[1] * _sc;
var _p11 = [ _p1[0] + lengthdir_x(_sy, _dr0 + 90),
_p1[1] + lengthdir_y(_sy, _dr0 + 90) ];
var _p12 = [ _p1[0] + lengthdir_x(_sy, _dr0 - 90),
_p1[1] + lengthdir_y(_sy, _dr0 - 90) ];
var _p00 = [ _p1[0] + lengthdir_x(_sx, _dr0),
_p1[1] + lengthdir_y(_sx, _dr0) ];
var _p22 = [ _p1[0] + lengthdir_x(_sx, _dr2),
_p1[1] + lengthdir_y(_sx, _dr2) ];
var _cc = _colr.eval(_ind);
var _aa = eval_curve_x(_alph, _lif / TOTAL_FRAMES);
@ -344,13 +332,23 @@ function Node_MK_Fall(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
draw_set_alpha(_aa);
if(_rtyp == 0) {
draw_primitive_begin(pr_trianglestrip);
var _dr0 = point_direction(_p1[0], _p1[1], _p0[0], _p0[1]);
var _dr2 = point_direction(_p1[0], _p1[1], _p2[0], _p2[1]);
var _p11 = [ _p1[0] + lengthdir_x(_sy, _dr0 + 90),
_p1[1] + lengthdir_y(_sy, _dr0 + 90) ];
var _p12 = [ _p1[0] + lengthdir_x(_sy, _dr0 - 90),
_p1[1] + lengthdir_y(_sy, _dr0 - 90) ];
var _p00 = [ _p1[0] + lengthdir_x(_sx, _dr0),
_p1[1] + lengthdir_y(_sx, _dr0) ];
var _p22 = [ _p1[0] + lengthdir_x(_sx, _dr2),
_p1[1] + lengthdir_y(_sx, _dr2) ];
draw_primitive_begin(pr_trianglestrip);
draw_vertex(_p00[0], _p00[1]);
draw_vertex(_p11[0], _p11[1]);
draw_vertex(_p12[0], _p12[1]);
draw_vertex(_p22[0], _p22[1]);
draw_primitive_end();
} else if(_rtyp == 1) {
draw_circle_prec(_p0[0], _p0[1], _sc, false, 16);

View file

@ -20,7 +20,7 @@ function Node_MK_Rain(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
inputs[| 6] = nodeValue("Alpha", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0.5, 1 ])
.setDisplay(VALUE_DISPLAY.slider_range);
inputs[| 7] = nodeValue("Velocity", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [ 1, 2 ])
inputs[| 7] = nodeValue("Velocity", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 2 ])
.setDisplay(VALUE_DISPLAY.vector_range);
inputs[| 8] = nodeValue("Seed", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, irandom_range(100_000, 999_999));
@ -38,7 +38,7 @@ function Node_MK_Rain(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
input_display_list = [ new Inspector_Sprite(s_MKFX), 0, 8,
["Shape", false], 9, 3, 4, 10, 11,
["Effect", false], 2, 1, 7, 12,
["Effect", false], 2, 1, 7,
["Render", false], 5, 6,
];
@ -102,8 +102,13 @@ function Node_MK_Rain(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
repeat(_dens) {
random_set_seed(_seed); _seed += 100;
var _rrad = _rad * (1 + random_range(_trex[0], _trex[1]));
var _r_shf = random_range( -_rad, _rad);
var _velRaw = max(1, random_range(_velo[0], _velo[1]));
var _vel = _velRaw < 1? _velRaw : floor(_velRaw);
var _vex = _velRaw < 1? 0 : frac(_velRaw);
var _ramo = _vel == 0? 1 : max(1, 1 / _vel);
var _rrad = _rad * (1 + _vex);
var _r_shf = random_range( -_rad, _rad);
var _y_shf = random(1);
var _drpW, _drpH, _drpS;
@ -129,34 +134,35 @@ function Node_MK_Rain(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
var _radHx = _radH * _tr_span_x;
var _radHy = _radH * _tr_span_y;
var _vel = max(1, irandom_range(_velo[0], _velo[1]));
var _prg = _y_shf + _vel * prg;
_prg = frac(_prg) - 0.5;
var _drpX = _rmx - _prg * _radHx * 2;
var _drpY = _rmy - _prg * _radHy * 2;
if(!_1c) draw_set_color(_colr.eval(random(1)));
draw_set_alpha(random_range(_alph[0], _alph[1]));
switch(_shap) {
case 0 :
var _tr_span_w = _tr_span_x * _drpH;
var _tr_span_h = _tr_span_y * _drpH;
for( var j = 0; j < _ramo; j++ ) {
var _drpX = _rmx - (_prg + j / _ramo) * _radHx * 2;
var _drpY = _rmy - (_prg + j / _ramo) * _radHy * 2;
switch(_shap) {
case 0 :
var _tr_span_w = _tr_span_x * _drpH;
var _tr_span_h = _tr_span_y * _drpH;
draw_line_width(
_drpX - _tr_span_w, _drpY - _tr_span_h,
_drpX + _tr_span_w, _drpY + _tr_span_h,
_drpW
);
break;
case 1 :
//draw_circle(round(_drpX), round(_drpY), _drpW, false);
draw_circle(_drpX, _drpY, _drpW, false);
break;
case 2 :
draw_surface_ext(_text, _drpX, _drpY, 1, 1, 0, draw_get_color(), draw_get_alpha());
break;
draw_line_width(
_drpX - _tr_span_w, _drpY - _tr_span_h,
_drpX + _tr_span_w, _drpY + _tr_span_h,
_drpW
);
break;
case 1 :
//draw_circle(round(_drpX), round(_drpY), _drpW, false);
draw_circle(_drpX, _drpY, _drpW, false);
break;
case 2 :
draw_surface_ext(_text, _drpX, _drpY, 1, 1, 0, draw_get_color(), draw_get_alpha());
break;
}
}
}

View file

@ -748,28 +748,29 @@ function __initNodes() {
addNodeObject(values, "Separate File Path", s_node_separate_file_path, "Node_Path_Separate_Folder", [1, Node_Path_Separate_Folder]).setVersion(1145);
ds_list_add(values, "Arrays");
addNodeObject(values, "Array", s_node_array, "Node_Array", [1, Node_Array]);
addNodeObject(values, "Array Range", s_node_array_range, "Node_Array_Range", [1, Node_Array_Range],, "Create array of numbers by setting start, end and step length.");
addNodeObject(values, "Array Add", s_node_array_add, "Node_Array_Add", [1, Node_Array_Add], ["add array"]);
addNodeObject(values, "Array Length", s_node_array_length, "Node_Array_Length", [1, Node_Array_Length]);
addNodeObject(values, "Array Get", s_node_array_get, "Node_Array_Get", [1, Node_Array_Get], ["get array"]);
addNodeObject(values, "Array Set", s_node_array_set, "Node_Array_Set", [1, Node_Array_Set], ["set array"]).setVersion(1120);
addNodeObject(values, "Array Find", s_node_array_find, "Node_Array_Find", [1, Node_Array_Find], ["find array"]).setVersion(1120);
addNodeObject(values, "Array Insert", s_node_array_insert, "Node_Array_Insert", [1, Node_Array_Insert], ["insert array"]).setVersion(1120);
addNodeObject(values, "Array Remove", s_node_array_remove, "Node_Array_Remove", [1, Node_Array_Remove], ["remove array", "delete array", "array delete"]).setVersion(1120);
addNodeObject(values, "Array Reverse", s_node_array_reverse, "Node_Array_Reverse", [1, Node_Array_Reverse], ["reverse array"]).setVersion(1120);
addNodeObject(values, "Array Shift", s_node_array_shift, "Node_Array_Shift", [1, Node_Array_Shift]).setVersion(1137);
addNodeObject(values, "Array Zip", s_node_array_zip, "Node_Array_Zip", [1, Node_Array_Zip]).setVersion(1138);
addNodeObject(values, "Array Copy", s_node_array_copy, "Node_Array_Copy", [1, Node_Array_Copy]).setVersion(1144);
addNodeObject(values, "Array Convolute",s_node_array_convolute, "Node_Array_Convolute", [1, Node_Array_Convolute]).setVersion(11540);
addNodeObject(values, "Array Composite",s_node_array_composite, "Node_Array_Composite", [1, Node_Array_Composite]).setVersion(11540);
addNodeObject(values, "Array Sample", s_node_array_sample, "Node_Array_Sample", [1, Node_Array_Sample]).setVersion(11540);
addNodeObject(values, "Sort Number", s_node_array_sort, "Node_Array_Sort", [1, Node_Array_Sort], ["array sort"]).setVersion(1120);
addNodeObject(values, "Shuffle Array", s_node_array_shuffle, "Node_Array_Shuffle", [1, Node_Array_Shuffle], ["array shuffle"]).setVersion(1120);
addNodeObject(values, "Loop Array", s_node_loop_array, "Node_Iterate_Each_Inline", [1, Node_Iterate_Each_Inline], ["iterate each", "for each", "array loop"], "Create group that iterate to each member in an array.");
addNodeObject(values, "Filter Array", s_node_filter_array, "Node_Iterate_Filter_Inline", [1, Node_Iterate_Filter_Inline],, "Filter array using condition.").setVersion(1140);
addNodeObject(values, "Sort Array", s_node_sort_array, "Node_Iterate_Sort_Inline", [1, Node_Iterate_Sort_Inline],, "Sort array using node graph.").setVersion(1143);
addNodeObject(values, "Parse CSV", s_node_csv_parse, "Node_Array_CSV_Parse", [1, Node_Array_CSV_Parse]).setVersion(1145);
addNodeObject(values, "Array", s_node_array, "Node_Array", [1, Node_Array]);
addNodeObject(values, "Array Range", s_node_array_range, "Node_Array_Range", [1, Node_Array_Range],, "Create array of numbers by setting start, end and step length.");
addNodeObject(values, "Array Add", s_node_array_add, "Node_Array_Add", [1, Node_Array_Add], ["add array"]);
addNodeObject(values, "Array Length", s_node_array_length, "Node_Array_Length", [1, Node_Array_Length]);
addNodeObject(values, "Array Get", s_node_array_get, "Node_Array_Get", [1, Node_Array_Get], ["get array"]);
addNodeObject(values, "Array Set", s_node_array_set, "Node_Array_Set", [1, Node_Array_Set], ["set array"]).setVersion(1120);
addNodeObject(values, "Array Find", s_node_array_find, "Node_Array_Find", [1, Node_Array_Find], ["find array"]).setVersion(1120);
addNodeObject(values, "Array Insert", s_node_array_insert, "Node_Array_Insert", [1, Node_Array_Insert], ["insert array"]).setVersion(1120);
addNodeObject(values, "Array Remove", s_node_array_remove, "Node_Array_Remove", [1, Node_Array_Remove], ["remove array", "delete array", "array delete"]).setVersion(1120);
addNodeObject(values, "Array Reverse", s_node_array_reverse, "Node_Array_Reverse", [1, Node_Array_Reverse], ["reverse array"]).setVersion(1120);
addNodeObject(values, "Array Shift", s_node_array_shift, "Node_Array_Shift", [1, Node_Array_Shift]).setVersion(1137);
addNodeObject(values, "Array Rearrange", s_node_array_rearrange, "Node_Array_Rearrange", [1, Node_Array_Rearrange]).setVersion(11640);
addNodeObject(values, "Array Zip", s_node_array_zip, "Node_Array_Zip", [1, Node_Array_Zip]).setVersion(1138);
addNodeObject(values, "Array Copy", s_node_array_copy, "Node_Array_Copy", [1, Node_Array_Copy]).setVersion(1144);
addNodeObject(values, "Array Convolute", s_node_array_convolute, "Node_Array_Convolute", [1, Node_Array_Convolute]).setVersion(11540);
addNodeObject(values, "Array Composite", s_node_array_composite, "Node_Array_Composite", [1, Node_Array_Composite]).setVersion(11540);
addNodeObject(values, "Array Sample", s_node_array_sample, "Node_Array_Sample", [1, Node_Array_Sample]).setVersion(11540);
addNodeObject(values, "Sort Number", s_node_array_sort, "Node_Array_Sort", [1, Node_Array_Sort], ["array sort"]).setVersion(1120);
addNodeObject(values, "Shuffle Array", s_node_array_shuffle, "Node_Array_Shuffle", [1, Node_Array_Shuffle], ["array shuffle"]).setVersion(1120);
addNodeObject(values, "Loop Array", s_node_loop_array, "Node_Iterate_Each_Inline", [1, Node_Iterate_Each_Inline], ["iterate each", "for each", "array loop"], "Create group that iterate to each member in an array.");
addNodeObject(values, "Filter Array", s_node_filter_array, "Node_Iterate_Filter_Inline", [1, Node_Iterate_Filter_Inline],, "Filter array using condition.").setVersion(1140);
addNodeObject(values, "Sort Array", s_node_sort_array, "Node_Iterate_Sort_Inline", [1, Node_Iterate_Sort_Inline],, "Sort array using node graph.").setVersion(1143);
addNodeObject(values, "Parse CSV", s_node_csv_parse, "Node_Array_CSV_Parse", [1, Node_Array_CSV_Parse]).setVersion(1145);
ds_list_add(values, "Paths");
addNodeObject(values, "Path", s_node_path, "Node_Path", [1, Node_Path]);
@ -852,7 +853,7 @@ function __initNodes() {
addNodeObject(animation, "Wiggler", s_node_wiggler, "Node_Wiggler", [1, Node_Wiggler],, "Create smooth random value.");
addNodeObject(animation, "Evaluate Curve", s_node_curve_eval, "Node_Anim_Curve", [1, Node_Anim_Curve],, "Evaluate value from an animation curve.");
addNodeObject(animation, "Rate Remap", s_node_rate_remap, "Node_Rate_Remap", [1, Node_Rate_Remap],, "Remap animation to a new framerate.").setVersion(1147);
addNodeObject(animation, "Stagger", s_node_rate_remap, "Node_Stagger", [1, Node_Stagger]).setVersion(11640);
addNodeObject(animation, "Stagger", s_node_stagger, "Node_Stagger", [1, Node_Stagger]).setVersion(11640);
ds_list_add(animation, "Audio");
addNodeObject(animation, "WAV File In", s_node_wav_file_read, "Node_WAV_File_Read", [0, Node_create_WAV_File_Read],, "Load wav audio file.").setVersion(1144);

View file

@ -80,7 +80,10 @@ function Node_Text(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
static generateFont = function(_path, _size, _aa) { #region
if(PROJECT.animator.is_playing) return;
if(_path == _font_current && _size == _size_current && _aa == _aa_current) return;
if( font_exists(font) &&
_path == _font_current &&
_size == _size_current &&
_aa == _aa_current) return;
_font_current = _path;
_size_current = _size;
@ -92,7 +95,7 @@ function Node_Text(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
font_delete(font);
font_add_enable_aa(_aa);
font = _font_add(_path, _size);
font = _font_add(_path, _size,, true);
} #endregion
static step = function() { #region

View file

@ -27,13 +27,15 @@ function NodeTool(name, spr, context = instanceof(other)) constructor {
return _nme;
}
static setSetting = function(sets) { array_push(settings, sets); return self; }
static addSetting = function(name, type, onEdit, keyAttr, val) {
var w;
switch(type) {
case VALUE_TYPE.float :
w = new textBox(TEXTBOX_INPUT.number, onEdit);
w.font = f_p2;
w.font = f_p3;
break;
case VALUE_TYPE.boolean :
w = new checkBox(onEdit);

View file

@ -569,6 +569,14 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
#endregion
#region ---- animation ----
if(_type == VALUE_TYPE.color) {
if(is_array(_value)) {
for( var i = 0, n = array_length(_value); i < n; i++ )
_value[i] = int64(cola(_value[i]));
} else
_value = int64(cola(_value));
}
key_inter = CURVE_TYPE.linear;
is_anim = false;
@ -577,6 +585,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
sepable = is_array(_value) && array_length(_value) > 1;
animator = new valueAnimator(_value, self, false);
animators = [];
if(is_array(_value))
for( var i = 0, n = array_length(_value); i < n; i++ ) {
animators[i] = new valueAnimator(_value[i], self, true);

View file

@ -297,6 +297,8 @@ function Panel(_parent, _x, _y, _w, _h) constructor { #region
function stepBegin() { #region
var con = getContent();
if(FULL_SCREEN_CONTENT != noone && con == FULL_SCREEN_CONTENT && self != FULL_SCREEN_PARENT) return;
for( var i = 0, n = array_length(content); i < n; i++ )
content[i].panelStepBegin(self);
@ -632,12 +634,15 @@ function Panel(_parent, _x, _y, _w, _h) constructor { #region
function drawPanel() { #region
if(w <= ui(16)) return;
var tab = array_length(content) > 1;
tx = x; ty = y + tab * ui(tab_height);
tw = w; th = h - tab * ui(tab_height);
if(th < ui(16)) return;
var con = getContent();
if(FULL_SCREEN_CONTENT != noone && con == FULL_SCREEN_CONTENT && self != FULL_SCREEN_PARENT) return;
if(tab) drawTab();
var p = ui(6);

View file

@ -1,10 +1,11 @@
#region data
globalvar PANEL_MAIN, PANEL_MENU, PANEL_PREVIEW, PANEL_INSPECTOR, PANEL_GRAPH, PANEL_ANIMATION, PANEL_COLLECTION;
globalvar FULL_SCREEN_PANEL, FULL_SCREEN_CONTENT;
globalvar FULL_SCREEN_PANEL, FULL_SCREEN_CONTENT, FULL_SCREEN_PARENT;
PANEL_MAIN = 0;
FULL_SCREEN_PANEL = noone;
FULL_SCREEN_CONTENT = noone;
FULL_SCREEN_PARENT = noone;
#endregion
#region panel class
@ -356,32 +357,34 @@
#region fullscreen
function set_focus_fullscreen() {
if(FULL_SCREEN_PANEL != noone) {
if(FULL_SCREEN_PANEL == noone) {
var panel = PREFERENCES.expand_hover? HOVER : FOCUS;
if(panel == noone) return;
if(!is_struct(panel)) return;
if(instanceof(panel) != "Panel") return;
if(array_length(panel.content) == 0) return;
var content = panel.getContent();
if(!content.expandable) return;
PANEL_MAIN.childs[| 1].setContent(content);
FULL_SCREEN_PARENT = PANEL_MAIN.childs[| 1];
FULL_SCREEN_PANEL = panel;
FULL_SCREEN_CONTENT = content;
content.onFullScreen();
} else {
PANEL_MAIN.childs[| 1].content = [];
PANEL_MAIN.refreshSize();
FULL_SCREEN_CONTENT.onFullScreen();
FULL_SCREEN_PARENT = noone;
FULL_SCREEN_PANEL = noone;
FULL_SCREEN_CONTENT = noone;
return;
}
var panel = PREFERENCES.expand_hover? HOVER : FOCUS;
if(panel == noone) return;
if(!is_struct(panel)) return;
if(instanceof(panel) != "Panel") return;
if(array_length(panel.content) == 0) return;
var content = panel.getContent();
if(!content.expandable) return;
PANEL_MAIN.childs[| 1].setContent(content);
FULL_SCREEN_PANEL = panel;
FULL_SCREEN_CONTENT = content;
content.onFullScreen();
}
#endregion

View file

@ -1790,12 +1790,11 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
if(array_empty(nodes_selecting)) return;
clipboard_set_text("");
var _map = {};
var _node = [];
var _map = {};
_map.nodes = [];
for(var i = 0; i < array_length(nodes_selecting); i++)
SAVE_NODE(_node, nodes_selecting[i],,,, getCurrentContext());
_map.nodes = _node;
SAVE_NODE(_map.nodes, nodes_selecting[i],,,, getCurrentContext());
clipboard_set_text(json_stringify_minify(_map));
} #endregion

View file

@ -633,12 +633,6 @@ function Panel_Inspector() : PanelContent() constructor {
if(jun.connect_type == JUNCTION_CONNECT.input && jun.type == VALUE_TYPE.color && jun.display_type == VALUE_DISPLAY._default) { #region color picker
pickers[color_picker_index] = jun;
if(color_picker_index == picker_index) {
if(color_picking && WIDGET_CURRENT == noone && !instance_exists(_p_dialog))
jun.editWidget.onColorPick();
color_picker_selecting = jun;
}
color_picker_index++;
} #endregion
@ -702,19 +696,21 @@ function Panel_Inspector() : PanelContent() constructor {
}
#region color picker
if(color_picker_selecting == noone)
picker_selecting = 0;
//if(color_picker_selecting == noone)
// picker_selecting = 0;
if(key_mod_press(ALT) && color_picker_index) {
var _p = picker_index;
pickers[picker_index].editWidget.onColorPick();
//var _p = picker_index;
if(mouse_wheel_down()) picker_index = safe_mod(picker_index + 1 + color_picker_index, color_picker_index);
if(mouse_wheel_up()) picker_index = safe_mod(picker_index - 1 + color_picker_index, color_picker_index);
//if(mouse_wheel_down()) picker_index = safe_mod(picker_index + 1 + color_picker_index, color_picker_index);
//if(mouse_wheel_up()) picker_index = safe_mod(picker_index - 1 + color_picker_index, color_picker_index);
if(_p != picker_index) {
instance_destroy(o_dialog_color_selector);
pickers[picker_index].editWidget.onColorPick();
}
//if(_p != picker_index) {
// instance_destroy(o_dialog_color_selector);
// pickers[picker_index].editWidget.onColorPick();
//}
}
if(MESSAGE != noone && MESSAGE.type == "Color") {

View file

@ -80,8 +80,14 @@ function Panel_Preview() : PanelContent() constructor {
tool_x = 0;
tool_x_to = 0;
tool_x_max = 0;
tool_y = 0;
tool_y_to = 0;
tool_y_max = 0;
tool_current = noone;
toolbar_width = ui(40);
toolbar_height = ui(40);
tool_hovering = false;
tool_side_drawing = false;
overlay_hovering = false;
@ -803,7 +809,7 @@ function Panel_Preview() : PanelContent() constructor {
if(d3_scene_preview != d3_scene)
d3_surface_bg = d3_scene_preview.renderBackground(w, h);
#endregion
#region shadow
if(d3_scene_preview == d3_scene) {
d3_scene_light0.shadow_map_scale = d3_view_camera.focus_dist * 2;
@ -1067,7 +1073,6 @@ function Panel_Preview() : PanelContent() constructor {
var _mx = mx;
var _my = my;
var isHover = pHOVER && mouse_on_preview == 1;
var tool_width = ui(40);
var tool_size = ui(32);
var cx = canvas_x + _node.preview_x * canvas_s;
@ -1076,14 +1081,14 @@ function Panel_Preview() : PanelContent() constructor {
tool_side_drawing = _node.tools != -1;
if(_node.tools != -1 && point_in_rectangle(_mx, _my, 0, 0, tool_width, h)) {
if(_node.tools != -1 && point_in_rectangle(_mx, _my, 0, 0, toolbar_width, h)) {
isHover = false;
mouse_on_preview = 0;
}
var overlayHover = tool_hovering == noone && !overlay_hovering;
overlayHover &= active && isHover;
overlayHover &= point_in_rectangle(mx, my, 0, toolbar_height, w, h - toolbar_height);
overlayHover &= point_in_rectangle(mx, my, toolbar_width, toolbar_height, w, h - toolbar_height);
overlayHover &= !key_mod_press(CTRL);
var params = { w, h, toolbar_height };
@ -1102,7 +1107,7 @@ function Panel_Preview() : PanelContent() constructor {
_snx = PROJECT.previewGrid.size[0];
_sny = PROJECT.previewGrid.size[1];
}
_node.drawOverlay(overlayHover, cx, cy, canvas_s, _mx, _my, _snx, _sny, params);
}
@ -1129,12 +1134,16 @@ function Panel_Preview() : PanelContent() constructor {
}
var aa = d3_active? 0.8 : 1;
draw_sprite_stretched_ext(THEME.tool_side, 1, 0, ui(32), tool_width, h - toolbar_height - ui(32), c_white, aa);
var xx = ui(1) + tool_width / 2;
var yy = ui(34) + tool_size / 2;
var pd = 2;
draw_sprite_stretched_ext(THEME.tool_side, 1, 0, ui(32), toolbar_width, h - toolbar_height - ui(32), c_white, aa);
tool_y_max = 0;
tool_y = lerp_float(tool_y, tool_y_to, 5);
var xx = ui(1) + toolbar_width / 2;
var yy = ui(34) + tool_size / 2 + tool_y;
var pd = 2;
var thov = pHOVER && point_in_rectangle(mx, my, 0, toolbar_height, toolbar_width, h - toolbar_height);
if(thov) canvas_hover = false;
for(var i = 0; i < array_length(_node.tools); i++) { #region iterate each tools
var tool = _node.tools[i];
var _x0 = xx - tool_size / 2;
@ -1142,10 +1151,9 @@ function Panel_Preview() : PanelContent() constructor {
var _x1 = xx + tool_size / 2;
var _y1 = yy + tool_size / 2;
if(point_in_rectangle(_mx, _my, _x0, _y0 + 1, _x1, _y1 - 1)) {
if(thov && point_in_rectangle(_mx, _my, _x0, _y0 + 1, _x1, _y1 - 1))
tool_hovering = tool;
}
if(tool.subtools > 0 && _tool == tool) { #region subtools
var s_ww = tool_size * tool.subtools;
var s_hh = tool_size;
@ -1161,7 +1169,7 @@ function Panel_Preview() : PanelContent() constructor {
var _sy0 = _syy - tool_size / 2;
var _sx1 = _sxx + tool_size / 2;
var _sy1 = _syy + tool_size / 2;
if(point_in_rectangle(_mx, _my, _sx0, _sy0 + 1, _sx1, _sy1 - 1)) {
TOOLTIP = tool.getDisplayName(j);
draw_sprite_stretched(THEME.button_hide, 1, _sx0 + pd, _sy0 + pd, tool_size - pd * 2, tool_size - pd * 2);
@ -1207,12 +1215,22 @@ function Panel_Preview() : PanelContent() constructor {
#endregion
}
yy += tool_size;
yy += tool_size;
tool_y_max += tool_size;
} #endregion
var _h = _node.drawTools(_mx, _my, xx, yy - tool_size / 2, tool_size, thov, pFOCUS);
yy += _h;
tool_y_max += _h;
tool_y_max = max(0, tool_y_max - h + toolbar_height * 2);
if(thov) {
if(mouse_wheel_up()) tool_y_to = clamp(tool_y_to + ui(64) * SCROLL_SPEED, -tool_y_max, 0);
if(mouse_wheel_down()) tool_y_to = clamp(tool_y_to - ui(64) * SCROLL_SPEED, -tool_y_max, 0);
}
} #endregion
function drawToolBar(_node) { #region
toolbar_height = ui(40);
var ty = h - toolbar_height;
//draw_sprite_stretched_ext(THEME.toolbar_shadow, 0, 0, ty - 12 + 4, w, 12, c_white, 0.5);
@ -1247,6 +1265,7 @@ function Panel_Preview() : PanelContent() constructor {
wdg.setFocusHover(pFOCUS, pHOVER);
switch(instanceof(wdg)) {
case "textBox" : tolw = ui(40); break;
case "checkBoxGroup" : tolw = tolh * wdg.size; break;
case "checkBox" : tolw = tolh; break;
case "scrollBox" : tolw = ui(96); break;
@ -1289,7 +1308,7 @@ function Panel_Preview() : PanelContent() constructor {
tx += string_width(hx) + ui(8);
draw_set_color(COLORS._main_text_sub);
draw_text(tx, cy + ch / 2, "(" + string(color_get_alpha(sample_color)) + ")");
draw_text(tx, cy + ch / 2, $"({color_get_alpha(sample_color)})");
}
#endregion
}

View file

@ -57,7 +57,7 @@
attributes = { #region
surface_dimension: [ 32, 32 ],
palette: [ c_black, c_white ]
palette: [ cola(c_black), cola(c_white) ]
} #endregion
attributeEditor = [ #region

View file

@ -73,12 +73,15 @@ function rotator(_onModify, _step = -1) : widget() constructor {
draw_sprite(spr_knob, 1, px, py);
if(val != drag_sv) {
if(onModify(val))
UNDO_HOLDING = true;
}
if(onModify(val))
UNDO_HOLDING = true;
if(mouse_release(mb_left)) {
if(mouse_press(mb_right)) {
onModify(drag_sv);
instance_destroy(dragging);
dragging = noone;
UNDO_HOLDING = false;
} else if(mouse_release(mb_left)) {
instance_destroy(dragging);
dragging = noone;
UNDO_HOLDING = false;

View file

@ -4,6 +4,7 @@ function rotatorRandom(_onModify) : widget() constructor {
dragging = false;
dragging_index = -1;
drag_sv = 0;
drag_dat = [ 0, 0, 0, 0, 0 ];
mode = 0;
tb_min_0 = new textBox(TEXTBOX_INPUT.number, function(val) { return onModify(1, val); } ).setSlidable(true, 1);
@ -153,8 +154,16 @@ function rotatorRandom(_onModify) : widget() constructor {
}
}
if(mouse_release(mb_left)) {
instance_destroy(dragging);
if(mouse_press(mb_right)) {
for( var i = 0; i < 5; i++ ) onModify(i, drag_dat[i]);
instance_destroy(rotator_Rotator);
dragging = noone;
dragging_index = -1;
UNDO_HOLDING = false;
} else if(mouse_release(mb_left)) {
instance_destroy(rotator_Rotator);
dragging = noone;
dragging_index = -1;
UNDO_HOLDING = false;
@ -170,6 +179,7 @@ function rotatorRandom(_onModify) : widget() constructor {
dragging_index = i;
drag_sv = _data[1 + i];
drag_dat = [ _data[0], _data[1], _data[2], _data[3], _data[4] ];
dragging = instance_create(0, 0, rotator_Rotator).init(_m, knx, kny);
}
}
@ -179,6 +189,7 @@ function rotatorRandom(_onModify) : widget() constructor {
dragging_index = 2;
drag_sv = [ _data[0], _data[1], _data[2], _data[3], _data[4] ];
drag_dat = [ _data[0], _data[1], _data[2], _data[3], _data[4] ];
dragging = instance_create(0, 0, rotator_Rotator).init(_m, knx, kny);
}
#endregion
@ -234,11 +245,19 @@ function rotatorRandom(_onModify) : widget() constructor {
if(onModify(2, val)) UNDO_HOLDING = true;
}
if(mouse_release(mb_left)) {
instance_destroy(dragging);
dragging = noone;
if(mouse_press(mb_right)) {
for( var i = 0; i < 5; i++ ) onModify(i, drag_dat[i]);
instance_destroy(rotator_Rotator);
dragging = noone;
dragging_index = -1;
UNDO_HOLDING = false;
UNDO_HOLDING = false;
} else if(mouse_release(mb_left)) {
instance_destroy(rotator_Rotator);
dragging = noone;
dragging_index = -1;
UNDO_HOLDING = false;
}
#endregion
} else if(hover) { #region
@ -249,6 +268,7 @@ function rotatorRandom(_onModify) : widget() constructor {
if(mouse_press(mb_left, active)) {
dragging_index = i;
drag_sv = [ _data[0], _data[1], _data[2], _data[3], _data[4] ];
drag_dat = [ _data[0], _data[1], _data[2], _data[3], _data[4] ];
dragging = instance_create(0, 0, rotator_Rotator).init(_m, knx, kny);
}
}
@ -308,11 +328,19 @@ function rotatorRandom(_onModify) : widget() constructor {
if(onModify(ind, val)) UNDO_HOLDING = true;
if(mouse_release(mb_left)) {
instance_destroy(dragging);
dragging = noone;
if(mouse_press(mb_right)) {
for( var i = 0; i < 5; i++ ) onModify(i, drag_dat[i]);
instance_destroy(rotator_Rotator);
dragging = noone;
dragging_index = -1;
UNDO_HOLDING = false;
UNDO_HOLDING = false;
} else if(mouse_release(mb_left)) {
instance_destroy(rotator_Rotator);
dragging = noone;
dragging_index = -1;
UNDO_HOLDING = false;
}
#endregion
} else if(hover) { #region
@ -323,6 +351,7 @@ function rotatorRandom(_onModify) : widget() constructor {
if(mouse_press(mb_left, active)) {
dragging_index = i;
drag_sv = [ _data[0], _data[1], _data[2], _data[3], _data[4] ];
drag_dat = [ _data[0], _data[1], _data[2], _data[3], _data[4] ];
dragging = instance_create(0, 0, rotator_Rotator).init(_m, knx, kny);
}
}
@ -389,11 +418,19 @@ function rotatorRandom(_onModify) : widget() constructor {
if(onModify(ind, val)) UNDO_HOLDING = true;
if(mouse_release(mb_left)) {
instance_destroy(dragging);
dragging = noone;
if(mouse_press(mb_right)) {
for( var i = 0; i < 5; i++ ) onModify(i, drag_dat[i]);
instance_destroy(rotator_Rotator);
dragging = noone;
dragging_index = -1;
UNDO_HOLDING = false;
UNDO_HOLDING = false;
} else if(mouse_release(mb_left)) {
instance_destroy(rotator_Rotator);
dragging = noone;
dragging_index = -1;
UNDO_HOLDING = false;
}
#endregion
} else if(hover) { #region
@ -404,6 +441,7 @@ function rotatorRandom(_onModify) : widget() constructor {
if(mouse_press(mb_left, active)) {
dragging_index = i;
drag_sv = [ _data[0], _data[1], _data[2], _data[3], _data[4] ];
drag_dat = [ _data[0], _data[1], _data[2], _data[3], _data[4] ];
dragging = instance_create(0, 0, rotator_Rotator).init(_m, knx, kny);
}
}

View file

@ -4,6 +4,7 @@ function rotatorRange(_onModify) : widget() constructor {
dragging_index = -1;
dragging = noone;
drag_sv = 0;
drag_dat = [ 0, 0 ];
tb_min = new textBox(TEXTBOX_INPUT.number, function(val) { return onModify(0, val); } ).setSlidable();
@ -114,11 +115,19 @@ function rotatorRange(_onModify) : widget() constructor {
}
}
if(mouse_release(mb_left)) {
instance_destroy(dragging);
dragging = noone;
if(mouse_press(mb_right)) {
for( var i = 0; i < 2; i++ ) onModify(i, drag_dat[i]);
instance_destroy(rotator_Rotator);
dragging = noone;
dragging_index = -1;
UNDO_HOLDING = false;
UNDO_HOLDING = false;
} else if(mouse_release(mb_left)) {
instance_destroy(rotator_Rotator);
dragging = noone;
dragging_index = -1;
UNDO_HOLDING = false;
}
#endregion
} else if(hover) { #region
@ -129,6 +138,7 @@ function rotatorRange(_onModify) : widget() constructor {
if(mouse_press(mb_left, active)) {
dragging_index = i;
drag_sv = _data[i];
drag_dat = [ _data[0], _data[1] ];
dragging = instance_create(0, 0, rotator_Rotator).init(_m, _x, knob_y);
}
}
@ -136,6 +146,7 @@ function rotatorRange(_onModify) : widget() constructor {
if(dragging_index == -1 && hover_arc && mouse_press(mb_left, active)) {
dragging_index = 2;
drag_sv = [ _data[0], _data[1] ];
drag_dat = [ _data[0], _data[1] ];
dragging = instance_create(0, 0, rotator_Rotator).init(_m, _x, knob_y);
}
} #endregion

View file

@ -25,6 +25,7 @@ function slider(_min, _max, _step, _onModify = noone, _onRelease = noone) : widg
spr = THEME.slider;
blend = c_white;
dragging = noone;
drag_sv = 0;
handle_w = ui(20);
tb_value = new textBox(TEXTBOX_INPUT.number, onApply);
@ -124,7 +125,12 @@ function slider(_min, _max, _step, _onModify = noone, _onRelease = noone) : widg
if(update_stat == SLIDER_UPDATE.realtime && onModify != noone && onModify(val))
UNDO_HOLDING = true;
if(mouse_release(mb_left)) {
if(mouse_press(mb_right)) {
onModify(drag_sv);
instance_destroy(dragging);
dragging = noone;
UNDO_HOLDING = false;
} else if(mouse_release(mb_left)) {
if(update_stat == SLIDER_UPDATE.release && onModify != noone)
onModify(val);
@ -142,6 +148,8 @@ function slider(_min, _max, _step, _onModify = noone, _onRelease = noone) : widg
dragging.drag_sx = _m[0];
dragging.drag_msx = _x;
dragging.drag_sw = sw;
drag_sv = current_value;
}
var amo = slide_speed;

View file

@ -7,6 +7,7 @@ function sliderRange(_min, _max, _step, _onModify) : widget() constructor {
onModify = _onModify;
dragging = noone;
drag_sv = 0;
tb_value_min = new textBox(TEXTBOX_INPUT.number, function(val) { return onModify(0, clamp(val, minn, maxx)); });
tb_value_max = new textBox(TEXTBOX_INPUT.number, function(val) { return onModify(1, clamp(val, minn, maxx)); });
@ -84,7 +85,12 @@ function sliderRange(_min, _max, _step, _onModify) : widget() constructor {
if(onModify(dragging_index, val))
UNDO_HOLDING = true;
if(mouse_release(mb_left)) {
if(mouse_press(mb_right)) {
onModify(dragging_index, drag_sv);
instance_destroy(dragging);
dragging = noone;
UNDO_HOLDING = false;
} else if(mouse_release(mb_left)) {
instance_destroy(dragging);
dragging = noone;
UNDO_HOLDING = false;
@ -108,6 +114,8 @@ function sliderRange(_min, _max, _step, _onModify) : widget() constructor {
dragging.drag_sx = _m[0];
dragging.drag_msx = _x0;
dragging.drag_sw = sw;
drag_sv = _data[_hover];
}
}

View file

@ -61,6 +61,7 @@ function __loadSteamUGCCollection(file_id, f, path) {
var name = string_replace(filename_name(f), ".pxcc", "");
var file = new FileObject(name, path + "/" + f);
var icon_path = string_replace(path + "/" + f, ".pxcc", ".png");
if(file_exists_empty(icon_path)) {
var _temp = sprite_add(icon_path, 0, false, false, 0, 0);
var ww = sprite_get_width(_temp);

View file

@ -14,9 +14,10 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor {
no_empty = true;
auto_update = false;
slidable = false;
sliding = false;
slide_sv = 0;
slidable = false;
sliding = false;
slide_int = false;
slide_sv = 0;
slide_speed = 1 / 10;
starting_char = 1;
@ -57,9 +58,10 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor {
onModify(value);
} #endregion
static setSlidable = function(slideStep = slide_speed) { #region
static setSlidable = function(slideStep = slide_speed, _slide_int = false) { #region
slidable = true;
slide_speed = slideStep;
slide_int = _slide_int;
return self;
} #endregion
@ -522,7 +524,7 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor {
draw_sprite_stretched_ext(THEME.textbox, 0, _x, _y, _w, _h, boxColor, 0.5 + 0.5 * interactable);
if(slidable) {
if(_w > ui(64))
if(_w > ui(64) && _h >= TEXTBOX_HEIGHT)
draw_sprite_ui_uniform(THEME.text_slider, 0, _x + ui(20), _y + _h / 2, 1, COLORS._main_icon, 0.5);
if(hover && point_in_rectangle(_m[0], _m[1], _x, _y, _x + _w, _y + _h) && mouse_press(mb_left, active)) {
@ -546,7 +548,7 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor {
var dx = _m[0] - slide_mx;
var dy = _m[1] - slide_my;
if(sliding == 1 && (abs(dx) > 16 || abs(dy) > 16)) {
if(sliding == 1 && (abs(dx) > 8 || abs(dy) > 8)) {
sliding = 2;
slide_sv = toNumber(_input_text);
textBox_slider.activate()
@ -554,7 +556,6 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor {
if(sliding == 2) {
textBox_slider.tb = self;
if(mouse_release(mb_left)) deactivate();
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

@ -0,0 +1,74 @@
{
"resourceType": "GMSprite",
"resourceVersion": "1.0",
"name": "s_node_array_rearrange",
"bbox_bottom": 51,
"bbox_left": 0,
"bbox_right": 63,
"bbox_top": 6,
"bboxMode": 0,
"collisionKind": 1,
"collisionTolerance": 0,
"DynamicTexturePage": false,
"edgeFiltering": false,
"For3D": false,
"frames": [
{"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"26aada31-d0f4-4eb1-8186-8aec250800e9",},
],
"gridX": 0,
"gridY": 0,
"height": 64,
"HTile": false,
"layers": [
{"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"6d19ed17-2e3d-4bac-aff8-76b6a8974c6c","blendMode":0,"displayName":"default","isLocked":false,"opacity":100.0,"visible":true,},
],
"nineSlice": null,
"origin": 4,
"parent": {
"name": "array",
"path": "folders/nodes/icons/value/array.yy",
},
"preMultiplyAlpha": false,
"sequence": {
"resourceType": "GMSequence",
"resourceVersion": "1.4",
"name": "s_node_array_rearrange",
"autoRecord": true,
"backdropHeight": 768,
"backdropImageOpacity": 0.5,
"backdropImagePath": "",
"backdropWidth": 1366,
"backdropXOffset": 0.0,
"backdropYOffset": 0.0,
"events": {"resourceType":"KeyframeStore<MessageEventKeyframe>","resourceVersion":"1.0","Keyframes":[],},
"eventStubScript": null,
"eventToFunction": {},
"length": 1.0,
"lockOrigin": false,
"moments": {"resourceType":"KeyframeStore<MomentsEventKeyframe>","resourceVersion":"1.0","Keyframes":[],},
"playback": 1,
"playbackSpeed": 30.0,
"playbackSpeedType": 0,
"showBackdrop": true,
"showBackdropImage": false,
"timeUnits": 1,
"tracks": [
{"resourceType":"GMSpriteFramesTrack","resourceVersion":"1.0","name":"frames","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"resourceType":"KeyframeStore<SpriteFrameKeyframe>","resourceVersion":"1.0","Keyframes":[
{"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"1.0","Channels":{"0":{"resourceType":"SpriteFrameKeyframe","resourceVersion":"1.0","Id":{"name":"26aada31-d0f4-4eb1-8186-8aec250800e9","path":"sprites/s_node_array_rearrange/s_node_array_rearrange.yy",},},},"Disabled":false,"id":"cb275a2a-f877-479c-b958-f6aa18c90372","IsCreationKey":false,"Key":0.0,"Length":1.0,"Stretch":false,},
],},"modifiers":[],"spriteId":null,"trackColour":0,"tracks":[],"traits":0,},
],
"visibleRange": null,
"volume": 1.0,
"xorigin": 32,
"yorigin": 32,
},
"swatchColours": null,
"swfPrecision": 2.525,
"textureGroupId": {
"name": "Default",
"path": "texturegroups/Default",
},
"type": 0,
"VTile": false,
"width": 64,
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View file

@ -0,0 +1,74 @@
{
"resourceType": "GMSprite",
"resourceVersion": "1.0",
"name": "s_node_stagger",
"bbox_bottom": 59,
"bbox_left": 3,
"bbox_right": 59,
"bbox_top": 3,
"bboxMode": 0,
"collisionKind": 1,
"collisionTolerance": 0,
"DynamicTexturePage": false,
"edgeFiltering": false,
"For3D": false,
"frames": [
{"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"b5942e7b-a9f8-4275-90b7-76d09dbb905b",},
],
"gridX": 0,
"gridY": 0,
"height": 64,
"HTile": false,
"layers": [
{"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"164b8a9c-adde-4dd4-839b-00dbed78b1e9","blendMode":0,"displayName":"default","isLocked":false,"opacity":100.0,"visible":true,},
],
"nineSlice": null,
"origin": 4,
"parent": {
"name": "animation",
"path": "folders/nodes/icons/animation.yy",
},
"preMultiplyAlpha": false,
"sequence": {
"resourceType": "GMSequence",
"resourceVersion": "1.4",
"name": "s_node_stagger",
"autoRecord": true,
"backdropHeight": 768,
"backdropImageOpacity": 0.5,
"backdropImagePath": "",
"backdropWidth": 1366,
"backdropXOffset": 0.0,
"backdropYOffset": 0.0,
"events": {"resourceType":"KeyframeStore<MessageEventKeyframe>","resourceVersion":"1.0","Keyframes":[],},
"eventStubScript": null,
"eventToFunction": {},
"length": 1.0,
"lockOrigin": false,
"moments": {"resourceType":"KeyframeStore<MomentsEventKeyframe>","resourceVersion":"1.0","Keyframes":[],},
"playback": 1,
"playbackSpeed": 30.0,
"playbackSpeedType": 0,
"showBackdrop": true,
"showBackdropImage": false,
"timeUnits": 1,
"tracks": [
{"resourceType":"GMSpriteFramesTrack","resourceVersion":"1.0","name":"frames","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"resourceType":"KeyframeStore<SpriteFrameKeyframe>","resourceVersion":"1.0","Keyframes":[
{"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"1.0","Channels":{"0":{"resourceType":"SpriteFrameKeyframe","resourceVersion":"1.0","Id":{"name":"b5942e7b-a9f8-4275-90b7-76d09dbb905b","path":"sprites/s_node_stagger/s_node_stagger.yy",},},},"Disabled":false,"id":"4ef0ddcd-ca17-482e-9c50-ae1d6c41674d","IsCreationKey":false,"Key":0.0,"Length":1.0,"Stretch":false,},
],},"modifiers":[],"spriteId":null,"trackColour":0,"tracks":[],"traits":0,},
],
"visibleRange": null,
"volume": 1.0,
"xorigin": 32,
"yorigin": 32,
},
"swatchColours": null,
"swfPrecision": 2.525,
"textureGroupId": {
"name": "Default",
"path": "texturegroups/Default",
},
"type": 0,
"VTile": false,
"width": 64,
}