This commit is contained in:
Tanasart 2023-02-23 13:02:19 +07:00
parent 036b20f4c7
commit 4849fe7bb9
99 changed files with 2058 additions and 1382 deletions

View file

@ -26,7 +26,6 @@
{"id":{"name":"node_3d_obj","path":"scripts/node_3d_obj/node_3d_obj.yy",},"order":8,},
{"id":{"name":"s_node_grid_tri_noise","path":"sprites/s_node_grid_tri_noise/s_node_grid_tri_noise.yy",},"order":22,},
{"id":{"name":"o_dialog_menubox","path":"objects/o_dialog_menubox/o_dialog_menubox.yy",},"order":1,},
{"id":{"name":"WindowMaximize","path":"extensions/WindowMaximize/WindowMaximize.yy",},"order":6,},
{"id":{"name":"s_node_blend","path":"sprites/s_node_blend/s_node_blend.yy",},"order":5,},
{"id":{"name":"s_node_rigidSim_object_spawner","path":"sprites/s_node_rigidSim_object_spawner/s_node_rigidSim_object_spawner.yy",},"order":5,},
{"id":{"name":"draw_text_function","path":"scripts/draw_text_function/draw_text_function.yy",},"order":11,},
@ -235,6 +234,7 @@
{"id":{"name":"s_node_curve_edit","path":"sprites/s_node_curve_edit/s_node_curve_edit.yy",},"order":0,},
{"id":{"name":"node_gradient","path":"scripts/node_gradient/node_gradient.yy",},"order":0,},
{"id":{"name":"textBox","path":"scripts/textBox/textBox.yy",},"order":17,},
{"id":{"name":"pathArrayBox","path":"scripts/pathArrayBox/pathArrayBox.yy",},"order":27,},
{"id":{"name":"node_statistic","path":"scripts/node_statistic/node_statistic.yy",},"order":7,},
{"id":{"name":"sh_draw_surface_part_tiled","path":"shaders/sh_draw_surface_part_tiled/sh_draw_surface_part_tiled.yy",},"order":1,},
{"id":{"name":"o_dialog_add_node","path":"objects/o_dialog_add_node/o_dialog_add_node.yy",},"order":1,},
@ -402,7 +402,6 @@
{"id":{"name":"s_node_image_copy","path":"sprites/s_node_image_copy/s_node_image_copy.yy",},"order":6,},
{"id":{"name":"node_boolean","path":"scripts/node_boolean/node_boolean.yy",},"order":17,},
{"id":{"name":"node_grid_tri","path":"scripts/node_grid_tri/node_grid_tri.yy",},"order":21,},
{"id":{"name":"window_command_hook","path":"extensions/window_command_hook/window_command_hook.yy",},"order":3,},
{"id":{"name":"node_average","path":"scripts/node_average/node_average.yy",},"order":5,},
{"id":{"name":"node_fluid_turbulence","path":"scripts/node_fluid_turbulence/node_fluid_turbulence.yy",},"order":10,},
{"id":{"name":"sh_sdf","path":"shaders/sh_sdf/sh_sdf.yy",},"order":1,},
@ -469,7 +468,7 @@
{"id":{"name":"node_VFX_spawner","path":"scripts/node_VFX_spawner/node_VFX_spawner.yy",},"order":1,},
{"id":{"name":"s_node_equation","path":"sprites/s_node_equation/s_node_equation.yy",},"order":0,},
{"id":{"name":"sh_color_replace","path":"shaders/sh_color_replace/sh_color_replace.yy",},"order":8,},
{"id":{"name":"Apollo","path":"extensions/Apollo/Apollo.yy",},"order":5,},
{"id":{"name":"Apollo","path":"extensions/Apollo/Apollo.yy",},"order":2,},
{"id":{"name":"rotator","path":"scripts/rotator/rotator.yy",},"order":11,},
{"id":{"name":"s_node_edge_detect","path":"sprites/s_node_edge_detect/s_node_edge_detect.yy",},"order":20,},
{"id":{"name":"node_fluid_add_collider","path":"scripts/node_fluid_add_collider/node_fluid_add_collider.yy",},"order":6,},
@ -566,6 +565,7 @@
{"id":{"name":"safe_operation","path":"scripts/safe_operation/safe_operation.yy",},"order":6,},
{"id":{"name":"s_node_rigid_override","path":"sprites/s_node_rigid_override/s_node_rigid_override.yy",},"order":9,},
{"id":{"name":"s_node_array_get","path":"sprites/s_node_array_get/s_node_array_get.yy",},"order":3,},
{"id":{"name":"o_dialog_load","path":"objects/o_dialog_load/o_dialog_load.yy",},"order":12,},
{"id":{"name":"s_node_BW","path":"sprites/s_node_BW/s_node_BW.yy",},"order":11,},
{"id":{"name":"sh_fd_turbulence","path":"shaders/sh_fd_turbulence/sh_fd_turbulence.yy",},"order":22,},
{"id":{"name":"s_node_compare","path":"sprites/s_node_compare/s_node_compare.yy",},"order":1,},
@ -694,6 +694,7 @@
{"id":{"name":"s_node_sampler","path":"sprites/s_node_sampler/s_node_sampler.yy",},"order":11,},
{"id":{"name":"__background_get_element","path":"scripts/__background_get_element/__background_get_element.yy",},"order":1,},
{"id":{"name":"node_animate_curve","path":"scripts/node_animate_curve/node_animate_curve.yy",},"order":0,},
{"id":{"name":"window_functions","path":"scripts/window_functions/window_functions.yy",},"order":27,},
{"id":{"name":"sh_fd_calculate_pressure_srj_glsl","path":"shaders/sh_fd_calculate_pressure_srj_glsl/sh_fd_calculate_pressure_srj_glsl.yy",},"order":9,},
{"id":{"name":"curve_bounce_function","path":"scripts/curve_bounce_function/curve_bounce_function.yy",},"order":1,},
{"id":{"name":"fd_rectangle_replace_material_surface","path":"scripts/fd_rectangle_replace_material_surface/fd_rectangle_replace_material_surface.yy",},"order":23,},
@ -826,7 +827,7 @@
{"id":{"name":"__view_get","path":"scripts/__view_get/__view_get.yy",},"order":1,},
{"id":{"name":"s_node_texture_map","path":"sprites/s_node_texture_map/s_node_texture_map.yy",},"order":36,},
{"id":{"name":"fd_rectangle_create","path":"scripts/fd_rectangle_create/fd_rectangle_create.yy",},"order":7,},
{"id":{"name":"libfilesystem","path":"extensions/libfilesystem/libfilesystem.yy",},"order":8,},
{"id":{"name":"libfilesystem","path":"extensions/libfilesystem/libfilesystem.yy",},"order":4,},
{"id":{"name":"s_node_level_selector","path":"sprites/s_node_level_selector/s_node_level_selector.yy",},"order":27,},
{"id":{"name":"random_function","path":"scripts/random_function/random_function.yy",},"order":3,},
{"id":{"name":"s_node_input","path":"sprites/s_node_input/s_node_input.yy",},"order":6,},
@ -923,7 +924,7 @@
{"id":{"name":"regex","path":"scripts/regex/regex.yy",},"order":0,},
{"id":{"name":"node_invert","path":"scripts/node_invert/node_invert.yy",},"order":6,},
{"id":{"name":"o_dialog_history","path":"objects/o_dialog_history/o_dialog_history.yy",},"order":3,},
{"id":{"name":"libdlgmodule","path":"extensions/libdlgmodule/libdlgmodule.yy",},"order":7,},
{"id":{"name":"libdlgmodule","path":"extensions/libdlgmodule/libdlgmodule.yy",},"order":3,},
{"id":{"name":"draw_background_stretched","path":"scripts/draw_background_stretched/draw_background_stretched.yy",},"order":5,},
{"id":{"name":"s_node_path","path":"sprites/s_node_path/s_node_path.yy",},"order":0,},
{"id":{"name":"node_tunnel_out","path":"scripts/node_tunnel_out/node_tunnel_out.yy",},"order":7,},
@ -961,7 +962,7 @@
{"id":{"name":"node_bw","path":"scripts/node_bw/node_bw.yy",},"order":0,},
{"id":{"name":"sh_de_corner","path":"shaders/sh_de_corner/sh_de_corner.yy",},"order":15,},
{"id":{"name":"node_rigid_object_spawner","path":"scripts/node_rigid_object_spawner/node_rigid_object_spawner.yy",},"order":6,},
{"id":{"name":"file_dropper","path":"extensions/file_dropper/file_dropper.yy",},"order":4,},
{"id":{"name":"file_dropper","path":"extensions/file_dropper/file_dropper.yy",},"order":1,},
{"id":{"name":"sh_fd_advect_velocity_0_glsl","path":"shaders/sh_fd_advect_velocity_0_glsl/sh_fd_advect_velocity_0_glsl.yy",},"order":6,},
{"id":{"name":"sprite_loader","path":"scripts/sprite_loader/sprite_loader.yy",},"order":10,},
{"id":{"name":"fd_rectangle_get_material_surface","path":"scripts/fd_rectangle_get_material_surface/fd_rectangle_get_material_surface.yy",},"order":12,},
@ -1056,6 +1057,7 @@
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"preview","folderPath":"folders/dialog/preview.yy","order":12,},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"widget","folderPath":"folders/dialog/widget.yy","order":14,},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"Extensions","folderPath":"folders/Extensions.yy","order":9,},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"Gameframe","folderPath":"folders/Extensions/Gameframe.yy","order":5,},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"font","folderPath":"folders/font.yy","order":7,},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"functions","folderPath":"folders/functions.yy","order":6,},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"3d","folderPath":"folders/functions/3d.yy","order":0,},
@ -1171,12 +1173,11 @@
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"sprites","folderPath":"folders/shader/sprites.yy","order":20,},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"warp","folderPath":"folders/shader/warp.yy","order":41,},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"sprites","folderPath":"folders/sprites.yy","order":12,},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"gameframe","folderPath":"folders/sprites/gameframe.yy","order":2,},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"texture","folderPath":"folders/sprites/texture.yy","order":0,},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"Steamworks","folderPath":"folders/Steamworks.yy","order":0,},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"UGC","folderPath":"folders/Steamworks/UGC.yy","order":0,},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"widgets","folderPath":"folders/widgets.yy","order":5,},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"Gameframe","folderPath":"folders/Extensions/Gameframe.yy","order":9,},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"gameframe","folderPath":"folders/sprites/gameframe.yy","order":2,},
],
"AudioGroups": [
{"resourceType":"GMAudioGroup","resourceVersion":"1.3","name":"audiogroup_default","targets":-1,},
@ -1488,9 +1489,9 @@
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_paste.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_copy.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Shiny gem.pxc","CopyToMask":-1,"filePath":"datafiles/Sample Projects",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_window_minimize.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_window_maximize.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_window_fullscreen.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_window_maximize.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_window_minimize.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"graphics x2.ai","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_window_exit.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"default.zip","CopyToMask":-1,"filePath":"datafiles/data/themes",},

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 310 B

After

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 568 B

After

Width:  |  Height:  |  Size: 433 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 360 B

After

Width:  |  Height:  |  Size: 365 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 176 B

View file

@ -9,13 +9,8 @@ event_inherited();
node_called = noone;
junction_hovering = noone;
if(ADD_NODE_W == -1 || ADD_NODE_H == -1) {
ADD_NODE_W = ui(532);
ADD_NODE_H = ui(400);
}
dialog_w = ADD_NODE_W;
dialog_h = ADD_NODE_H;
dialog_w = PREF_MAP[? "dialog_add_node_w"];
dialog_h = PREF_MAP[? "dialog_add_node_h"];
destroy_on_click_out = true;
@ -409,8 +404,8 @@ event_inherited();
content_pane.resize(dialog_w - ui(136), dialog_h - ui(66));
search_pane.resize(dialog_w - ui(32), dialog_h - ui(66));
ADD_NODE_W = dialog_w;
ADD_NODE_H = dialog_h;
PREF_MAP[? "dialog_add_node_w"] = dialog_w;
PREF_MAP[? "dialog_add_node_h"] = dialog_h;
}
#endregion

View file

@ -1,5 +1,6 @@
/// @description init
if !ready exit;
draw_set_color(c_black);
draw_set_alpha(0.5);
draw_rectangle(0, 0, WIN_W, WIN_H, false);

View file

@ -155,7 +155,7 @@ event_inherited();
draw_sprite_stretched_ext(THEME.node_active, 1, ui(4), yy, sp_preset_w - ui(16), hg, COLORS._main_accent, 1);
draw_set_text(f_p2, fa_left, fa_top, COLORS._main_text_sub);
draw_text(ui(16), yy + ui(8), preset_name[| i]);
draw_text(ui(16), yy + ui(8), filename_name_only(preset_name[| i]));
draw_gradient(ui(16), yy + ui(28), ww, ui(16), presets[| i]);
if(_hover && isHover && mouse_press(mb_left, sFOCUS)) {
@ -223,7 +223,7 @@ event_inherited();
draw_sprite_stretched_ext(THEME.node_active, 1, ui(4), yy, sp_palette_w - ui(16), _height, COLORS._main_accent, 1);
draw_set_text(f_p2, fa_left, fa_top, COLORS._main_text_sub);
draw_text(ui(16), yy + ui(8), palette_name[| i]);
draw_text(ui(16), yy + ui(8), filename_name_only(palette_name[| i]));
if(palette_selecting == i)
drawPaletteGrid(palettes[| i], ui(16), yy + ui(28), ww, _gs);
else

View file

@ -0,0 +1,12 @@
/// @description init
event_inherited();
#region data
newFile = false;
path = "";
readonly = false;
safe_mode = false;
dialog_w = ui(400);
dialog_h = ui(140);
#endregion

View file

@ -0,0 +1,55 @@
/// @description init
if !ready exit;
draw_set_color(c_black);
draw_set_alpha(0.5);
draw_rectangle(0, 0, WIN_W, WIN_H, false);
draw_set_alpha(1);
#region base UI
draw_sprite_stretched(THEME.dialog_bg, 0, dialog_x, dialog_y, dialog_w, dialog_h);
if(sFOCUS)
draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1);
#endregion
#region text
var py = dialog_y + ui(16);
draw_set_text(f_h5, fa_left, fa_top, COLORS._main_text_title);
draw_text(dialog_x + ui(24), py, "Project modified");
py += line_height(, 4);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
draw_text(dialog_x + ui(24), py, "Do you want to save progress?");
var bw = ui(96), bh = TEXTBOX_HEIGHT;
var bx1 = dialog_x + dialog_w - ui(16);
var by1 = dialog_y + dialog_h - ui(16);
var bx0 = bx1 - bw;
var by0 = by1 - bh;
draw_set_text(f_p1, fa_center, fa_center, COLORS._main_text);
var b = buttonInstant(THEME.button, bx0, by0, bw, bh, mouse_ui, sFOCUS, sHOVER);
draw_text(bx0 + bw / 2, by0 + bh / 2, "Cancel");
if(b == 2)
instance_destroy();
bx0 -= bw + ui(12);
var b = buttonInstant(THEME.button, bx0, by0, bw, bh, mouse_ui, sFOCUS, sHOVER);
draw_text(bx0 + bw / 2, by0 + bh / 2, "Don't save");
if(b == 2) {
if(newFile) __NEW();
else __LOAD_PATH(path, readonly, safe_mode);
instance_destroy();
}
bx0 -= bw + ui(12);
var b = buttonInstant(THEME.button, bx0, by0, bw, bh, mouse_ui, sFOCUS, sHOVER);
draw_text(bx0 + bw / 2, by0 + bh / 2, "Save");
if(b == 2) {
SAVE();
if(newFile) __NEW();
else __LOAD_PATH(path, readonly, safe_mode);
instance_destroy();
}
#endregion

View file

@ -0,0 +1,37 @@
{
"resourceType": "GMObject",
"resourceVersion": "1.0",
"name": "o_dialog_load",
"spriteId": null,
"solid": false,
"visible": true,
"managed": true,
"spriteMaskId": null,
"persistent": false,
"parentObjectId": {
"name": "_p_dialog",
"path": "objects/_p_dialog/_p_dialog.yy",
},
"physicsObject": false,
"physicsSensor": false,
"physicsShape": 1,
"physicsGroup": 1,
"physicsDensity": 0.5,
"physicsRestitution": 0.1,
"physicsLinearDamping": 0.1,
"physicsAngularDamping": 0.1,
"physicsFriction": 0.2,
"physicsStartAwake": true,
"physicsKinematic": false,
"physicsShapePoints": [],
"eventList": [
{"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":64,"eventType":8,"collisionObjectId":null,},
{"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,},
],
"properties": [],
"overriddenProperties": [],
"parent": {
"name": "menu",
"path": "folders/dialog/menu.yy",
},
}

View file

@ -14,7 +14,7 @@ event_inherited();
show_icon = false;
function setMenu(_menu) {
function setMenu(_menu, align = fa_left) {
menu = _menu;
dialog_x = x;
dialog_y = y;
@ -67,10 +67,12 @@ event_inherited();
if(show_icon)
dialog_w += ui(32);
if(dialog_x + dialog_w > WIN_W - ui(16))
dialog_x = WIN_W - ui(16) - dialog_w;
if(dialog_y + dialog_h > WIN_H - ui(16))
dialog_y = WIN_H - ui(16) - dialog_h;
dialog_y = min(dialog_y, WIN_H - dialog_h);
switch(align) {
case fa_left: dialog_x = round(min(dialog_x, WIN_W - dialog_w)); break;
case fa_center: dialog_x = round(min(dialog_x - dialog_w / 2, WIN_W - dialog_w)); break;
}
ready = true;
}

View file

@ -55,7 +55,7 @@ event_inherited();
if(noti.type & filter == 0) continue;
draw_set_font(f_p2);
var _w = sp_noti.w - ui(12);
var _w = sp_noti.surface_w;
var _h = ui(8) + string_height_ext(noti.txt, -1, txw) + ui(8);
if(yy >= -_h && yy <= sp_noti.h) {
@ -131,8 +131,6 @@ event_inherited();
yy += _h;
hh += _h;
if(yy > sp_noti.h) break;
}
return hh;

View file

@ -85,7 +85,7 @@ event_inherited();
draw_sprite_stretched_ext(THEME.node_active, 1, ui(4), yy, sp_preset_w - ui(16), hg, COLORS._main_accent, 1);
draw_set_text(f_p2, fa_left, fa_top, COLORS._main_text_sub);
draw_text(ui(16), yy + ui(8), preset_name[| i]);
draw_text(ui(16), yy + ui(8), filename_name_only(preset_name[| i]));
drawPalette(presets[| i], ui(16), yy + ui(28), ww, ui(16));
if(isHover && mouse_press(mb_left, sFOCUS)) {

View file

@ -34,7 +34,7 @@ if palette == 0 exit;
sp_presets.draw(presets_x + ui(24), dialog_y + ui(44));
var bx = presets_x + presets_w - ui(44);
var by = dialog_y + ui(10);
var by = dialog_y + ui(12);
if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, get_text("add_preset", "Add to preset"), THEME.add) == 2) {
var dia = dialogCall(o_dialog_file_name, mouse_mx + ui(8), mouse_my + ui(8));

View file

@ -15,7 +15,11 @@
#region window
gameframe_init();
//gameframe_can_input = false;
gameframe_button_array = [];
gameframe_set_cursor = false;
gameframe_caption_height_normal = ui(40);
gameframe_button_array = [ game_frame_button_create("", s_kenney, 0, function() {}),
game_frame_button_create("", s_kenney, 0, function() {}),
];
depth = 0;
win_wp = WIN_W;
@ -54,6 +58,13 @@
addHotkey("", "Full panel", "`", MOD_KEY.none, set_focus_fullscreen);
addHotkey("", "Open notification", vk_f12, MOD_KEY.none, function() { dialogCall(o_dialog_notifications); });
addHotkey("", "Fullscreen", vk_f11, MOD_KEY.none, function() {
if(gameframe_is_fullscreen_window())
gameframe_set_fullscreen(0);
else
gameframe_set_fullscreen(2);
});
addHotkey("", "Render all", vk_f5, MOD_KEY.none, function() {
UPDATE |= RENDER_TYPE.full;
});
@ -171,8 +182,6 @@
#region parameter
file_open_parameter = "";
window_command_hook(window_command_close);
_modified = false;
#endregion

View file

@ -1,4 +1,9 @@
/// @description init
if(gameframe_is_minimized()) {
gameframe_update();
exit;
}
#region widget scroll
if(keyboard_check_pressed(vk_tab) && key_mod_press(SHIFT))
widget_previous();
@ -27,4 +32,30 @@
surface_reset_target();
noti_warning(exception_print(e));
}
gameframe_update();
#endregion
#region window
var pd = gameframe_resize_padding;
if(mouse_mx > 0 && mouse_mx < pd && mouse_my > 0 && mouse_my < WIN_H)
CURSOR = cr_size_we;
if(mouse_mx > WIN_W - pd && mouse_mx < WIN_W && mouse_my > 0 && mouse_my < WIN_H)
CURSOR = cr_size_we;
if(mouse_mx > 0 && mouse_mx < WIN_W && mouse_my > 0 && mouse_my < pd)
CURSOR = cr_size_ns;
if(mouse_mx > 0 && mouse_mx < WIN_W && mouse_my > WIN_H - pd && mouse_my < WIN_H)
CURSOR = cr_size_ns;
if(mouse_mx > 0 && mouse_mx < pd && mouse_my > 0 && mouse_my < pd)
CURSOR = cr_size_nwse;
if(mouse_mx > WIN_W - pd && mouse_mx < WIN_W && mouse_my > WIN_H - pd && mouse_my < WIN_H)
CURSOR = cr_size_nwse;
if(mouse_mx > 0 && mouse_mx < pd && mouse_my > WIN_H - pd && mouse_my < WIN_H)
CURSOR = cr_size_nesw;
if(mouse_mx > WIN_W - pd && mouse_mx < WIN_W && mouse_my > 0 && mouse_my < pd)
CURSOR = cr_size_nesw;
#endregion

View file

@ -60,3 +60,8 @@
draw_set_alpha(1);
}
#endregion
#region frame
draw_set_color(COLORS._main_icon_dark);
draw_rectangle(1, 1, WIN_W - 2, WIN_H - 2, true);
#endregion

View file

@ -93,15 +93,6 @@
#endregion
#region window
if (window_command_check(window_command_close)) {
if(MODIFIED && !READONLY) {
dialogCall(o_dialog_exit);
} else {
PREF_SAVE();
game_end();
}
}
if(_modified != MODIFIED) {
_modified = MODIFIED;

View file

@ -1,7 +1,6 @@
/// @description init
#region window
//if(keyboard_check_pressed(vk_f12)) DEBUG = !DEBUG;
gameframe_update();
if(_cursor != CURSOR) {
window_set_cursor(CURSOR);
@ -9,7 +8,7 @@
}
CURSOR = cr_default;
if((win_wp != WIN_W || win_hp != WIN_H) && (WIN_W > 1 && WIN_H > 1))
if(!gameframe_is_minimized() && (win_wp != WIN_W || win_hp != WIN_H) && (WIN_W > 1 && WIN_H > 1))
display_refresh();
#endregion

View file

@ -19,7 +19,7 @@
"option_windows_splash_screen": "${base_options_dir}/windows/splash/splash.png",
"option_windows_use_splash": false,
"option_windows_start_fullscreen": false,
"option_windows_allow_fullscreen_switching": true,
"option_windows_allow_fullscreen_switching": false,
"option_windows_interpolate_pixels": false,
"option_windows_vsync": false,
"option_windows_resize_window": true,

View file

@ -253,9 +253,14 @@ enum CAMERA_PROJ {
matrix_stack_pop();
}
function _3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca, _proj = CAMERA_PROJ.perspective, _fov = 60, _pass = "diff", _applyLocal = true) {
function _3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca, _cam, _pass = "diff", _scale = noone) {
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1]);
var _proj = _cam.projection;
var _fov = _cam.fov;
var _applyLocal = _scale == noone? true : _scale.local;
var scaleDimension = _scale == noone? true : _scale.dimension;
var lightFor = [ -cos(degtorad(_ldir)), -_lhgt, -sin(degtorad(_ldir)) ];
gpu_set_ztestenable(true);
@ -301,9 +306,9 @@ enum CAMERA_PROJ {
camera_apply(cam);
if(_proj == CAMERA_PROJ.ortho)
matrix_stack_push(matrix_build(dw / 2 - _pos[0], _pos[1] - dh / 2, 0, 0, 0, 0, dw * _sca[0], dh * _sca[1], 1));
matrix_stack_push(matrix_build(dw / 2 - _pos[0], _pos[1] - dh / 2, 0, 0, 0, 0, (scaleDimension? dw : 1) * _sca[0], (scaleDimension? dh : 1) * _sca[1], 1));
else
matrix_stack_push(matrix_build(dw / 2 - _pos[0], _pos[1] - dh / 2, 0, 0, 0, 0, dw * _sca[0], dh * _sca[1], 1));
matrix_stack_push(matrix_build(dw / 2 - _pos[0], _pos[1] - dh / 2, 0, 0, 0, 0, (scaleDimension? dw : 1) * _sca[0], (scaleDimension? dh : 1) * _sca[1], 1));
//matrix_stack_push(matrix_build(0, 0, 0, 0, 0, 0, 1, 1, 1));
if(_applyLocal) _3d_local_transform(_lpos, _lrot, _lsca);

View file

@ -49,7 +49,7 @@ function __part(_node) constructor {
anim_speed = 1;
anim_end = ANIM_END_ACTION.loop;
function create(_surf, _x, _y, _life) {
static create = function(_surf, _x, _y, _life) {
active = true;
surf = _surf;
x = _x;
@ -61,7 +61,7 @@ function __part(_node) constructor {
node.onPartCreate(self);
}
function setPhysic(_sx, _sy, _ac, _g, _wig) {
static setPhysic = function(_sx, _sy, _ac, _g, _wig) {
sx = _sx;
sy = _sy;
ac = _ac;
@ -69,7 +69,8 @@ function __part(_node) constructor {
wig = _wig;
}
function setTransform(_scx, _scy, _sct, _rot, _rots, _follow) {
static setTransform = function(_scx, _scy, _sct, _rot, _rots, _follow) {
sc_sx = _scx;
sc_sy = _scy;
sct = _sct;
@ -78,7 +79,8 @@ function __part(_node) constructor {
rot_s = _rots;
follow = _follow;
}
function setDraw(_col, _blend, _alp, _fade) {
static setDraw = function(_col, _blend, _alp, _fade) {
col = _col;
blend = _blend;
alp = _alp;
@ -86,7 +88,7 @@ function __part(_node) constructor {
alp_fade = _fade;
}
function kill() {
static kill = function() {
active = false;
node.onPartDestroy(self);
}
@ -119,7 +121,7 @@ function __part(_node) constructor {
if(life-- < 0) kill();
}
function draw(exact, surf_w, surf_h) {
static draw = function(exact, surf_w, surf_h) {
if(!active) return;
var ss = surf;
if(is_array(surf)) {
@ -142,8 +144,10 @@ function __part(_node) constructor {
}
if(!is_surface(ss)) return;
scx = sc_sx * eval_curve_x(sct, 1 - life / life_total);
scy = sc_sy * eval_curve_x(sct, 1 - life / life_total);
var lifeRat = 1 - life / life_total;
var scCurve = eval_curve_x(sct, lifeRat);
scx = sc_sx * scCurve;
scy = sc_sy * scCurve;
var _xx, _yy;
var s_w = surface_get_width(ss) * scx;
@ -176,15 +180,15 @@ function __part(_node) constructor {
var x1 = _xx + s_w * 1.5;
var y1 = _yy + s_h * 1.5;
if(x0 > surf_w || y0 > surf_h || x1 < 0 || y1 < 0) return;
if(x0 > surf_w || y0 > surf_h || x1 < 0 || y1 < 0) return; //culling
var cc = (col == -1)? c_white : gradient_eval(col, 1 - life / life_total);
cc = colorMultiply(blend, cc);
alp_draw = alp * eval_curve_x(alp_fade, 1 - life / life_total);
draw_surface_ext_safe(ss, _xx, _yy, scx, scy, rot, cc, alp_draw);
var cc = (col == -1)? c_white : gradient_eval(col, lifeRat);
if(blend != c_white) cc = colorMultiply(blend, cc);
alp_draw = alp * eval_curve_x(alp_fade, lifeRat);
draw_surface_ext(ss, _xx, _yy, scx, scy, rot, cc, alp_draw);
}
function getPivot() {
static getPivot = function() {
if(boundary_data == -1)
return [x, y];

View file

@ -359,13 +359,7 @@ function Node_VFX_Spawner_Base(_x, _y, _group = -1) : Node(_x, _y, _group) const
onStep();
}
static onStep = function() {
RETURN_ON_REST
if(ANIMATOR.current_frame == 0)
reset();
runVFX(ANIMATOR.current_frame);
}
static onStep = function() {}
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
inputs[| 3].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);

View file

@ -75,8 +75,12 @@ function buttonClass(_onClick, _icon = noone) : widget() constructor {
function buttonInstant(spr, _x, _y, _w, _h, _m, _act, _hvr, _tip = "", _icon = noone, _icon_index = 0, _icon_blend = COLORS._main_icon, _icon_alpha = 1) {
var res = 0;
var cc = is_array(_icon_blend)? _icon_blend[0] : _icon_blend;
if(_hvr && point_in_rectangle(_m[0], _m[1], _x, _y, _x + _w, _y + _h)) {
if(is_array(_icon_blend))
cc = _icon_blend[1];
res = 1;
draw_sprite_stretched(spr, 1, _x, _y, _w, _h);
if(_tip != "")
@ -87,13 +91,18 @@ function buttonInstant(spr, _x, _y, _w, _h, _m, _act, _hvr, _tip = "", _icon = n
if(mouse_press(mb_right, _act))
res = 3;
if(mouse_release(mb_left, _act))
res = -2;
if(mouse_release(mb_right, _act))
res = -3;
if(mouse_click(mb_left, _act))
draw_sprite_stretched(spr, 2, _x, _y, _w, _h);
} else
draw_sprite_stretched(spr, 0, _x, _y, _w, _h);
if(_icon)
draw_sprite_ui_uniform(_icon, _icon_index, _x + _w / 2, _y + _h / 2, 1, _icon_blend, _icon_alpha);
draw_sprite_ui_uniform(_icon, _icon_index, _x + _w / 2, _y + _h / 2, 1, cc, _icon_alpha);
return res;
}

View file

@ -17,15 +17,19 @@ function colorBrightness(clr) {
}
function colorMultiply(c1, c2) {
var r1 = color_get_red(c1) / 255;
var g1 = color_get_green(c1) / 255;
var b1 = color_get_blue(c1) / 255;
if(c1 * c2 == 0) return 0;
if(c1 == c_white) return c2;
if(c2 == c_white) return c1;
var r2 = color_get_red(c2) / 255;
var g2 = color_get_green(c2) / 255;
var b2 = color_get_blue(c2) / 255;
var r1 = color_get_red(c1);
var g1 = color_get_green(c1);
var b1 = color_get_blue(c1);
return make_color_rgb((r1 * r2) * 255, (g1 * g2) * 255, (b1 * b2) * 255);
var r2 = color_get_red(c2);
var g2 = color_get_green(c2);
var b2 = color_get_blue(c2);
return make_color_rgb((r1 * r2) / 255, (g1 * g2) / 255, (b1 * b2) / 255);
}
function color_diff(c1, c2) {

View file

@ -73,6 +73,14 @@ function eval_curve_segment_t(_bz, t) {
}
function eval_curve_x(_bz, _x, _prec = 0.00001) {
static _CURVE_DEF_01 = [0, 0, 0, 0, 1/3, 1/3, /**/ -1/3, -1/3, 1, 1, 0, 0];
static _CURVE_DEF_10 = [0, 0, 0, 1, 1/3, -1/3, /**/ -1/3, 1/3, 1, 0, 0, 0];
static _CURVE_DEF_11 = [0, 0, 0, 1, 1/3, 0, /**/ -1/3, 0, 1, 1, 0, 0];
if(array_equals(_bz, _CURVE_DEF_11)) return 1;
if(array_equals(_bz, _CURVE_DEF_01)) return _x;
if(array_equals(_bz, _CURVE_DEF_10)) return 1 - _x;
var segments = array_length(_bz) / 6 - 1;
_x = clamp(_x, 0, 1);

View file

@ -19,9 +19,9 @@ function dialogCall(_dia, _x = noone, _y = noone, param = {}) {
return dia;
}
function menuCall(_x = mouse_mx + ui(4), _y = mouse_my + ui(4), menu = []) {
function menuCall(_x = mouse_mx + ui(4), _y = mouse_my + ui(4), menu = [], align = fa_left) {
var dia = dialogCall(o_dialog_menubox, _x, _y);
dia.setMenu(menu);
dia.setMenu(menu, align);
return dia;
}

View file

@ -5,7 +5,7 @@ function FileObject(_name, _path) constructor {
spr = -1;
content = -1;
surface = noone;
meta = noone;
meta = noone;
static getSurface = function() {
if(is_surface(surface)) return surface;
@ -45,6 +45,12 @@ function FileObject(_name, _path) constructor {
meta.version = m[? "version"];
meta.name = name;
switch(filename_ext(path)) {
case ".pxc" : meta.type = FILE_TYPE.project; break;
case ".pxcc" : meta.type = FILE_TYPE.collection; break;
default : meta.type = FILE_TYPE.assets; break;
}
ds_map_destroy(m);
return meta;

View file

@ -13,8 +13,5 @@ function display_refresh() {
PANEL_PREVIEW.fullView();
o_main.alarm[0] = 10;
PREF_MAP[? "window_width"] = WIN_W;
PREF_MAP[? "window_height"] = WIN_H;
PREF_SAVE();
}

View file

@ -83,10 +83,14 @@ function gameframe_update() {
if (__titleHit) {
var __now = current_time;
if (__now < gameframe_last_title_click_at + gameframe_double_click_time) {
if (gameframe_isMaximized_hx) gameframe_restore(); else gameframe_maximize();
//if (gameframe_isMaximized_hx) gameframe_restore(); else gameframe_maximize();
} else {
gameframe_last_title_click_at = __now;
if (gameframe_isMaximized_hx) gameframe_drag_start(32); else gameframe_drag_start(16);
if (gameframe_isMaximized_hx) {
gameframe_drag_start(32);
} else {
gameframe_drag_start(16);
}
}
} else if (__flags != 0 && gameframe_can_resize) {
gameframe_drag_start(__flags);
@ -586,6 +590,7 @@ function gameframe_tools_rect_set_to(_this1, _o) {
#region gameframe
function gameframe_minimize() {
gameframe_drag_flags = 0;
/// gameframe_minimize()
/// @returns {void}
if (gameframe_is_natively_minimized()) exit;
@ -931,6 +936,7 @@ function gameframe_delayed_item_create() {
function gameframe_drag_start(__flags) {
// gameframe_drag_start(_flags:int)
gameframe_drag_init = 0;
gameframe_drag_flags = __flags;
gameframe_drag_mx = (display_mouse_get_x() | 0);
gameframe_drag_my = (display_mouse_get_y() | 0);
@ -942,6 +948,12 @@ function gameframe_drag_start(__flags) {
function gameframe_drag_stop() {
// gameframe_drag_stop()
if(gameframe_drag_flags == 16) {
if(display_mouse_get_y() <= gameframe_resize_padding)
gameframe_maximize();
}
gameframe_drag_flags = 0;
}
@ -956,7 +968,17 @@ function gameframe_drag_update() {
var __mx = (display_mouse_get_x() | 0);
var __my = (display_mouse_get_y() | 0);
switch (gameframe_drag_flags) {
case 16: window_set_position(__mx - (gameframe_drag_mx - gameframe_drag_left), __my - (gameframe_drag_my - gameframe_drag_top)); break;
case 16:
if(gameframe_drag_init == 0) {
var dist = point_distance(gameframe_drag_mx, gameframe_drag_my, __mx, __my);
if(dist > 8) {
gameframe_drag_init = 1;
//gameframe_drag_mx = __mx;
//gameframe_drag_my = __my;
}
} else
window_set_position(__mx - (gameframe_drag_mx - gameframe_drag_left), __my - (gameframe_drag_my - gameframe_drag_top));
break;
case 32:
if (point_distance(__mx, __my, gameframe_drag_mx, gameframe_drag_my) > 5) {
var __x;
@ -1029,6 +1051,7 @@ function gameframe_tools_keyctl_update() {
for (var __g1 = array_length(gameframe_tools_keyctl_keys); _i < __g1; _i++) {
gameframe_tools_keyctl_update_key(gameframe_tools_keyctl_keys[_i]);
}
if (gameframe_tools_keyctl_up[2/* pressed */]) {
if (gameframe_can_resize) gameframe_maximize();
} else if (gameframe_tools_keyctl_down[2/* pressed */]) {
@ -1278,6 +1301,8 @@ gameframe_delayed_frame_index = 0;
// gameframe_drag:
globalvar gameframe_drag_flags; /// @is {int}
gameframe_drag_flags = 0;
globalvar gameframe_drag_init; /// @is {int}
gameframe_drag_init = 0;
globalvar gameframe_drag_mx; /// @is {int}
gameframe_drag_mx = 0;
globalvar gameframe_drag_my; /// @is {int}

View file

@ -30,7 +30,7 @@
globalvar VERSION, SAVEFILE_VERSION, VERSION_STRING;
VERSION = 1130;
SAVEFILE_VERSION = 1300;
VERSION_STRING = "1.13.pr14";
VERSION_STRING = "1.13";
globalvar NODES, NODE_MAP, APPEND_MAP, HOTKEYS, HOTKEY_CONTEXT;
@ -56,10 +56,8 @@
HOVER = noone;
DIALOG_CLICK = true;
globalvar ADD_NODE_PAGE, ADD_NODE_W, ADD_NODE_H;
globalvar ADD_NODE_PAGE;
ADD_NODE_PAGE = 0;
ADD_NODE_W = -1;
ADD_NODE_H = -1;
#endregion
#region macro

View file

@ -32,6 +32,8 @@ function draw_gradient(_x, _y, _w, _h, _grad, _int = GRADIENT_INTER.smooth) {
var _grad_time = [];
for(var i = 0; i < array_length(_grad); i++) {
if(_grad[i].value == undefined) return;
_grad_color[i * 4 + 0] = color_get_red(_grad[i].value) / 255;
_grad_color[i * 4 + 1] = color_get_green(_grad[i].value) / 255;
_grad_color[i * 4 + 2] = color_get_blue(_grad[i].value) / 255;
@ -104,6 +106,8 @@ function gradient_to_array(_gradient) {
var _grad_color = [], _grad_time = [];
for(var i = 0; i < array_length(_gradient); i++) {
if(is_undefined(_gradient[i].value)) continue;
_grad_color[i * 4 + 0] = color_get_red(_gradient[i].value) / 255;
_grad_color[i * 4 + 1] = color_get_green(_gradient[i].value) / 255;
_grad_color[i * 4 + 2] = color_get_blue(_gradient[i].value) / 255;

View file

@ -14,6 +14,16 @@ function LOAD() {
}
function LOAD_PATH(path, readonly = false, safe_mode = false) {
if(MODIFIED && !READONLY) {
var dia = dialogCall(o_dialog_load);
dia.path = path;
dia.readonly = readonly;
dia.safe_mode = safe_mode;
} else
__LOAD_PATH(path, readonly, safe_mode);
}
function __LOAD_PATH(path, readonly = false, safe_mode = false) {
SAFE_MODE = safe_mode;
if(DEMO) return false;
@ -28,18 +38,19 @@ function LOAD_PATH(path, readonly = false, safe_mode = false) {
return false;
}
LOADING = true;
nodeCleanUp();
clearPanel();
setPanel();
instance_destroy(_p_dialog);
room_restart();
//room_restart();
var temp_path = DIRECTORY + "\_temp";
if(file_exists(temp_path)) file_delete(temp_path);
file_copy(path, temp_path);
ALWAYS_FULL = false;
LOADING = true;
READONLY = readonly;
SET_PATH(path);

View file

@ -1,6 +1,12 @@
#region tags
globalvar META_TAGS;
META_TAGS = [ "3D", "Disappear", "Effect", "Filter", "Generator", "Transform", "Transition", "Utility" ];
enum FILE_TYPE {
project,
collection,
assets
}
#endregion
function MetaDataManager() constructor {
@ -9,6 +15,7 @@ function MetaDataManager() constructor {
author = "";
contact = "";
alias = "";
type = FILE_TYPE.collection;
author_steam_id = 0;
file_id = 0;
tags = [];
@ -66,6 +73,22 @@ function MetaDataManager() constructor {
var ww = ui(320), _w = 0;
var _h = 0;
if(type == FILE_TYPE.assets) {
draw_set_font(f_p0);
_h = string_height(name);
_w = string_width(name);
var mx = min(mouse_mx + ui(16), WIN_W - (_w + ui(16)));
var my = min(mouse_my + ui(16), WIN_H - (_h + ui(16)));
draw_sprite_stretched(THEME.textbox, 3, mx, my, _w + ui(16), _h + ui(16));
draw_sprite_stretched(THEME.textbox, 0, mx, my, _w + ui(16), _h + ui(16));
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
draw_text(mx + ui(8), my + ui(8), name);
return;
}
var _aut = "By " + author;
var _ver = get_text("meta_old_version", "Created on an older version");

View file

@ -52,7 +52,10 @@ function Node_3D_Combine(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
.setDisplay(VALUE_DISPLAY.slider, [ 0, 90, 1 ])
.rejectArray();
input_display_list = [ 0,
inputs[| 13] = nodeValue("Scale view with dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true)
input_display_list = [
["Surface", false], 0, 13,
["Object transform", false], 1, 2, 3,
["Camera", false], 11, 12, 4, 5,
["Light", false], 6, 7, 8, 9, 10,
@ -161,6 +164,7 @@ function Node_3D_Combine(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
var _proj = inputs[| 11].getValue();
var _fov = inputs[| 12].getValue();
var _dimS = inputs[| 13].getValue();
inputs[| 12].setVisible(_proj);
@ -175,7 +179,10 @@ function Node_3D_Combine(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
case 2 : pass = "norm" break;
}
_3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca, _proj, _fov, pass, false);
var _cam = { projection: _proj, fov: _fov };
var _scale = { local: false, dimension: _dimS };
_3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca, _cam, pass, _scale);
submit_vertex();
_3d_post_setup();
}

View file

@ -54,7 +54,10 @@ function Node_3D_Extrude(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) c
inputs[| 17] = nodeValue("Field of view", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 60)
.setDisplay(VALUE_DISPLAY.slider, [ 0, 90, 1 ]);
input_display_list = [1,
inputs[| 18] = nodeValue("Scale view with dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true)
input_display_list = [
["Surface", false], 1, 18,
["Geometry", false], 0, 8, 14,
["Object transform", false], 2, 3, 4,
["Camera", false], 16, 17, 5, 7, 15,
@ -264,6 +267,7 @@ function Node_3D_Extrude(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) c
var _proj = _data[16];
var _fov = _data[17];
var _dimS = _data[18];
inputs[| 17].setVisible(_proj);
@ -279,7 +283,10 @@ function Node_3D_Extrude(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) c
if(_upda && ANIMATOR.frame_progress)
generateMesh();
_3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca, _proj, _fov, pass, false);
var _cam = { projection: _proj, fov: _fov };
var _scale = { local: false, dimension: _dimS };
_3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca, _cam, pass, _scale);
submit_vertex(_array_index);
_3d_post_setup();

View file

@ -70,7 +70,10 @@ function Node_3D_Obj(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
.setDisplay(VALUE_DISPLAY.slider, [ 0, 90, 1 ])
.rejectArray();
input_display_list = [ 2,
inputs[| 17] = nodeValue("Scale view with dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true)
input_display_list = [
["Surface", false], 2, 17,
["Geometry", false], 0, 1,
["Object transform", false], 14, 13, 11,
["Camera", false], 15, 16, 3, 5,
@ -92,8 +95,10 @@ function Node_3D_Obj(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
_3d_node_init(2, /*Transform*/ 3, 13, 5);
tex_surface = surface_create(1, 1);
function reset_tex() {
tex_surface = surface_create(1, 1);
tex_surface = surface_verify(tex_surface, 1, 1);
surface_set_target(tex_surface);
draw_clear(c_black);
surface_reset_target();
@ -226,6 +231,7 @@ function Node_3D_Obj(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
var _proj = inputs[| 15].getValue();
var _fov = inputs[| 16].getValue();
var _dimS = inputs[| 17].getValue();
inputs[| 16].setVisible(_proj == 1);
@ -240,9 +246,16 @@ function Node_3D_Obj(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
case 2 : pass = "norm" break;
}
_3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca, _proj, _fov, pass, false);
var _cam = { projection: _proj, fov: _fov };
var _scale = { local: false, dimension: _dimS };
_3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca, _cam, pass, _scale);
submit_vertex();
_3d_post_setup();
}
}
static onCleanUp = function() {
surface_free(tex_surface);
}
}

View file

@ -43,7 +43,10 @@ function Node_3D_Transform(_x, _y, _group = -1) : Node_Processor(_x, _y, _group)
inputs[| 13] = nodeValue("Field of view", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 60)
.setDisplay(VALUE_DISPLAY.slider, [ 0, 90, 1 ]);
input_display_list = [ 0, 11,
inputs[| 14] = nodeValue("Scale view with dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true)
input_display_list = [ 11,
["Surface", false], 0, 14,
["Object transform", false], 1, 2, 3,
["Camera", false], 12, 13, 4, 5,
["Light", true], 6, 7, 8, 9, 10,
@ -106,6 +109,7 @@ function Node_3D_Transform(_x, _y, _group = -1) : Node_Processor(_x, _y, _group)
var _proj = _data[12];
var _fov = _data[13];
var _dimS = _data[14];
var pass = "diff";
switch(_output_index) {
@ -113,7 +117,10 @@ function Node_3D_Transform(_x, _y, _group = -1) : Node_Processor(_x, _y, _group)
case 2 : pass = "norm" break;
}
_3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca, _proj, _fov, pass, false);
var _cam = { projection: _proj, fov: _fov };
var _scale = { local: false, dimension: _dimS };
_3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca, _cam, pass, _scale);
submit_vertex();
_3d_post_setup();

View file

@ -48,7 +48,10 @@ function Node_3D_Cone(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) cons
inputs[| 16] = nodeValue("Textures side", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
input_display_list = [0,
inputs[| 17] = nodeValue("Scale view with dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true)
input_display_list = [
["Surface", false], 0, 17,
["Geometry", false], 14,
["Object transform", false], 11, 10, 4,
["Camera", false], 12, 13, 1, 3,
@ -160,6 +163,7 @@ function Node_3D_Cone(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) cons
var _proj = _data[12];
var _fov = _data[13];
var _dimS = _data[17];
inputs[| 13].setVisible(_proj);
@ -169,7 +173,10 @@ function Node_3D_Cone(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) cons
case 2 : pass = "norm" break;
}
_3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca, _proj, _fov, pass);
var _cam = { projection: _proj, fov: _fov };
var _scale = { local: true, dimension: _dimS };
_3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca, _cam, pass, _scale);
matrix_set(matrix_world, matrix_stack_top());
vertex_submit(VB_top, pr_trianglelist, surface_get_texture(face_bas));

View file

@ -55,11 +55,14 @@ function Node_3D_Cube(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) cons
inputs[| 21] = nodeValue("Field of view", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 60)
.setDisplay(VALUE_DISPLAY.slider, [ 0, 90, 1 ]);
input_display_list = [1,
["Object transform",false], 19, 18, 12,
["Camera", false], 20, 21, 2, 4,
["Texture", true], 0, 5, 6, 7, 8, 9, 10, 11,
["Light", false], 13, 14, 15, 16, 17,
inputs[| 22] = nodeValue("Scale view with dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true)
input_display_list = [
["Surface", false], 1, 22,
["Object transform", false], 19, 18, 12,
["Camera", false], 20, 21, 2, 4,
["Texture", true], 0, 5, 6, 7, 8, 9, 10, 11,
["Light", false], 13, 14, 15, 16, 17,
];
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
@ -131,6 +134,7 @@ function Node_3D_Cube(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) cons
var _proj = _data[20];
var _fov = _data[21];
var _dimS = _data[22];
inputs[| 21].setVisible(_proj);
@ -143,7 +147,10 @@ function Node_3D_Cube(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) cons
case 2 : pass = "norm" break;
}
_3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca, _proj, _fov, pass);
var _cam = { projection: _proj, fov: _fov };
var _scale = { local: true, dimension: _dimS };
_3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca, _cam, pass, _scale);
if(_usetex) {
for(var i = 0; i < 6; i++) {

View file

@ -54,7 +54,10 @@ function Node_3D_Cylinder(_x, _y, _group = -1) : Node_Processor(_x, _y, _group)
inputs[| 19] = nodeValue("Taper", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1)
.setDisplay(VALUE_DISPLAY.slider, [ 0, 1, 0.01 ]);
input_display_list = [2,
inputs[| 20] = nodeValue("Scale view with dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true)
input_display_list = [
["Surface", false], 2, 20,
["Geometry", false], 0, 1, 19,
["Object transform", false], 16, 15, 9,
["Camera", false], 17, 18, 3, 5,
@ -187,6 +190,7 @@ function Node_3D_Cylinder(_x, _y, _group = -1) : Node_Processor(_x, _y, _group)
var _proj = _data[17];
var _fov = _data[18];
var _dimS = _data[20];
inputs[| 18].setVisible(_proj);
@ -196,7 +200,10 @@ function Node_3D_Cylinder(_x, _y, _group = -1) : Node_Processor(_x, _y, _group)
case 2 : pass = "norm" break;
}
_3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca, _proj, _fov, pass);
var _cam = { projection: _proj, fov: _fov };
var _scale = { local: true, dimension: _dimS };
_3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca, _cam, pass, _scale);
matrix_set(matrix_world, matrix_stack_top());
vertex_submit(VB_top, pr_trianglelist, surface_get_texture(face_top));

View file

@ -48,7 +48,10 @@ function Node_3D_Sphere(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) co
inputs[| 15] = nodeValue("Field of view", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 60)
.setDisplay(VALUE_DISPLAY.slider, [ 0, 90, 1 ]);
input_display_list = [1,
inputs[| 16] = nodeValue("Scale view with dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true)
input_display_list = [
["Surface", false], 1, 16,
["Geometry", false], 0,
["Object transform", false], 13, 12, 6,
["Camera", false], 14, 15, 2, 4,
@ -174,6 +177,7 @@ function Node_3D_Sphere(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) co
var _proj = _data[14];
var _fov = _data[15];
var _dimS = _data[16];
inputs[| 15].setVisible(_proj);
@ -183,7 +187,10 @@ function Node_3D_Sphere(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) co
case 2 : pass = "norm" break;
}
_3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca, _proj, _fov, pass);
var _cam = { projection: _proj, fov: _fov };
var _scale = { local: true, dimension: _dimS };
_3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca, _cam, pass, _scale);
vertex_submit(VB, pr_trianglelist, surface_get_texture(texture));
_3d_post_setup();

View file

@ -66,7 +66,10 @@ function Node_3D_Repeat(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
inputs[| 21] = nodeValue("Field of view", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 60)
.setDisplay(VALUE_DISPLAY.slider, [ 0, 90, 1 ]);
input_display_list = [ 0, 11,
inputs[| 22] = nodeValue("Scale view with dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true)
input_display_list = [ 11,
["Surface", false], 0, 22,
["Object transform", true], 1, 2, 3,
["Camera", true], 20, 21, 4, 5,
["Light", true], 6, 7, 8, 9, 10,
@ -183,6 +186,7 @@ function Node_3D_Repeat(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
var _proj = inputs[| 20].getValue();
var _fov = inputs[| 21].getValue();
var _dimS = inputs[| 22].getValue();
var _patt = inputs[| 16].getValue();
@ -197,7 +201,10 @@ function Node_3D_Repeat(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
case 2 : pass = "norm" break;
}
_3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca, _proj, _fov, pass, false);
var _cam = { projection: _proj, fov: _fov };
var _scale = { local: false, dimension: _dimS };
_3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca, _cam, pass, _scale);
submit_vertex();
_3d_post_setup();
}

View file

@ -3,6 +3,8 @@ function Node_VFX_Renderer(_x, _y, _group = -1) : Node(_x, _y, _group) construct
color = COLORS.node_blend_vfx;
icon = THEME.vfx;
use_cache = true;
inputs[| 0] = nodeValue("Output dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, def_surf_size2)
.setDisplay(VALUE_DISPLAY.vector);
@ -25,6 +27,11 @@ function Node_VFX_Renderer(_x, _y, _group = -1) : Node(_x, _y, _group) construct
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
insp2UpdateTooltip = "Clear cache";
insp2UpdateIcon = [ THEME.cache, 0, COLORS._main_icon ];
static onInspector2Update = function() { clearCache(); }
static refreshDynamicInput = function() {
var _l = ds_list_create();
for( var i = 0; i < ds_list_size(inputs); i++ ) {
@ -51,6 +58,11 @@ function Node_VFX_Renderer(_x, _y, _group = -1) : Node(_x, _y, _group) construct
}
function update(_time = ANIMATOR.current_frame) {
if(!ANIMATOR.is_playing) {
recoverCache();
return;
}
var _dim = inputs[| 0].getValue(_time);
var _exact = inputs[| 1].getValue(_time);
var _blend = inputs[| 2].getValue(_time);

View file

@ -26,6 +26,14 @@ function Node_VFX_Spawner(_x, _y, _group = -1) : Node_VFX_Spawner_Base(_x, _y, _
}
}
static onStep = function() {
RETURN_ON_REST
if(ANIMATOR.current_frame == 0)
reset();
runVFX(ANIMATOR.current_frame);
}
static onSpawn = function(_time, part) {
part.step_int = inputs[| input_len + 1].getValue(_time);
}

View file

@ -46,7 +46,7 @@ function Node_Blend(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constr
["Transform", false], 5, 10, 11,
]
temp = surface_create(1, 1);
temp_surface = [ surface_create(1, 1) ];
static process_data = function(_outSurf, _data, _output_index, _array_index) {
var _back = _data[0];
@ -77,8 +77,8 @@ function Node_Blend(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constr
var fw = surface_get_width(_fore);
var fh = surface_get_height(_fore);
temp = surface_verify(temp, ww, hh);
_foreDraw = temp;
temp_surface[0] = surface_verify(temp_surface[0], ww, hh);
_foreDraw = temp_surface[0];
var sx = 0;
var sy = 0;
@ -95,7 +95,7 @@ function Node_Blend(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constr
case 2 : sy = hh - fh; break;
}
surface_set_target(temp);
surface_set_target(temp_surface[0]);
draw_clear_alpha(0, 0);
BLEND_ALPHA
draw_surface(_fore, sx, sy);

View file

@ -30,7 +30,7 @@ function Node_Blur_Contrast(_x, _y, _group = -1) : Node_Processor(_x, _y, _group
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
pass = surface_create(1, 1);
temp_surface = [ surface_create(1, 1) ];
static process_data = function(_outSurf, _data, _output_index, _array_index) {
var _surf = _data[0];
@ -42,9 +42,9 @@ function Node_Blur_Contrast(_x, _y, _group = -1) : Node_Processor(_x, _y, _group
var ww = surface_get_width(_surf);
var hh = surface_get_height(_surf);
pass = surface_verify(pass, ww, hh);
temp_surface[0] = surface_verify(temp_surface[0], ww, hh);
surface_set_target(pass);
surface_set_target(temp_surface[0]);
draw_clear_alpha(0, 0);
BLEND_OVERRIDE;
shader_set(shader);
@ -62,7 +62,7 @@ function Node_Blur_Contrast(_x, _y, _group = -1) : Node_Processor(_x, _y, _group
BLEND_OVERRIDE;
shader_set(shader);
shader_set_uniform_i(uniform_dir, 1);
draw_surface_safe(pass, 0, 0);
draw_surface_safe(temp_surface[0], 0, 0);
shader_reset();
BLEND_NORMAL;
surface_reset_target();

View file

@ -9,7 +9,7 @@ function Node_Blur_Radial(_x, _y, _group = -1) : Node_Processor(_x, _y, _group)
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
inputs[| 1] = nodeValue("Strength", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1)
inputs[| 1] = nodeValue("Strength", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 45)
.setDisplay(VALUE_DISPLAY.rotation);
inputs[| 2] = nodeValue("Center", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0 ])
@ -47,8 +47,8 @@ function Node_Blur_Radial(_x, _y, _group = -1) : Node_Processor(_x, _y, _group)
var _str = _data[1];
var _cen = _data[2];
var _sam = _data[3];
var _mask = _data[3];
var _mix = _data[4];
var _mask = _data[4];
var _mix = _data[5];
_cen[0] /= surface_get_width(_outSurf);
_cen[1] /= surface_get_height(_outSurf);

View file

@ -580,4 +580,8 @@ function Node_Canvas(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
buffer_set_surface(surface_buffer, canvas_surface, 0);
surface_update();
}
static onCleanUp = function() {
surface_free(canvas_surface);
}
}

View file

@ -8,9 +8,9 @@ function Node_Chromatic_Aberration(_x, _y, _group = -1) : Node_Processor(_x, _y,
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
inputs[| 1] = nodeValue("Center", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0 ])
inputs[| 1] = nodeValue("Center", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0.5, 0.5 ])
.setDisplay(VALUE_DISPLAY.vector)
.setUnitRef(function(index) { return getDimension(index); });
.setUnitRef(function(index) { return getDimension(index); }, VALUE_UNIT.reference);
inputs[| 2] = nodeValue("Strength", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1)
.setDisplay(VALUE_DISPLAY.slider, [-16, 16, 0.01]);

View file

@ -236,7 +236,7 @@ function Node_Composite(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) co
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
temp_surf = [ surface_create(1, 1), surface_create(1, 1) ];
temp_surface = [ surface_create(1, 1), surface_create(1, 1) ];
surf_dragging = -1;
input_dragging = -1;
@ -554,9 +554,9 @@ function Node_Composite(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) co
surface_size_to(_outSurf, ww, hh);
for(var i = 0; i < 2; i++) {
temp_surf[i] = surface_verify(temp_surf[i], surface_get_width(_outSurf), surface_get_height(_outSurf));
temp_surface[i] = surface_verify(temp_surface[i], surface_get_width(_outSurf), surface_get_height(_outSurf));
surface_set_target(temp_surf[i]);
surface_set_target(temp_surface[i]);
draw_clear_alpha(0, 0);
surface_reset_target();
}

View file

@ -17,8 +17,8 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
if(!LOADING && !APPENDING) {
recordAction(ACTION_TYPE.node_added, self);
NODE_MAP[? node_id] = self;
MODIFIED = true;
}
MODIFIED = true;
name = "";
display_name = "";
@ -65,6 +65,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
use_cache = false;
cached_output = [];
cache_result = [];
temp_surface = [];
tools = -1;
@ -173,9 +174,11 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
}
static move = function(_x, _y) {
if(x == _x && y == _y) return;
x = _x;
y = _y;
MODIFIED = true;
if(!LOADING) MODIFIED = true;
}
inspUpdateTooltip = get_text("panel_inspector_execute", "Execute node");
@ -194,9 +197,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
insp2UpdateTooltip = get_text("panel_inspector_execute", "Execute node");
insp2UpdateIcon = [ THEME.sequence_control, 1, COLORS._main_value_positive ];
static inspector2Update = function() {
onInspectorSecondaryUpdate();
}
static inspector2Update = function() { onInspector2Update(); }
static onInspector2Update = noone;
static hasInspector2Update = function() { return onInspector2Update != noone; }
@ -297,7 +298,6 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
static triggerRender = function() {
setRenderStatus(false);
UPDATE |= RENDER_TYPE.partial;
cache_result[0] = false;
//ds_queue_enqueue(RENDER_QUEUE, self);
for(var i = 0; i < ds_list_size(outputs); i++) {
@ -450,8 +450,8 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
var xx = x * _s + _x;
var yy = y * _s + _y;
show_input_name = point_in_rectangle(_mx, _my, xx - 8 * _s, yy + 20 * _s, xx + 8 * _s, yy + h * _s);
show_output_name = point_in_rectangle(_mx, _my, xx + (w - 8) * _s, yy + 20 * _s, xx + (w + 8) * _s, yy + h * _s);
show_input_name = PANEL_GRAPH.pHOVER && point_in_rectangle(_mx, _my, xx - 8 * _s, yy + 20 * _s, xx + 8 * _s, yy + h * _s);
show_output_name = PANEL_GRAPH.pHOVER && point_in_rectangle(_mx, _my, xx + (w - 8) * _s, yy + 20 * _s, xx + (w + 8) * _s, yy + h * _s);
if(show_input_name) {
for(var i = 0; i < amo; i++) {
@ -468,13 +468,11 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
}
if(show_output_name) {
for(var i = 0; i < ds_list_size(outputs); i++) {
for(var i = 0; i < ds_list_size(outputs); i++)
outputs[| i].drawNameBG(_s);
}
for(var i = 0; i < ds_list_size(outputs); i++) {
for(var i = 0; i < ds_list_size(outputs); i++)
outputs[| i].drawName(_s, _mx, _my);
}
}
}
@ -499,6 +497,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
var hover = false;
var th = max(1, PREF_MAP[? "connection_line_width"] * _s);
if(PANEL_GRAPH.pHOVER)
switch(PREF_MAP[? "curve_connection_line"]) {
case 0 :
hover = distance_to_line(mx, my, jx, jy, frx, fry) < 6;
@ -719,6 +718,12 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
ds_list_clear(jun.value_to);
}
for( var i = 0; i < ds_list_size(inputs); i++ )
inputs[| i].destroy();
for( var i = 0; i < ds_list_size(outputs); i++ )
outputs[| i].destroy();
onDestroy();
}
@ -807,7 +812,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
static cacheExist = function(frame = ANIMATOR.current_frame) {
if(frame >= array_length(cached_output)) return false;
if(frame >= array_length(cache_result)) return false;
//if(!array_safe_get(cache_result, frame)) return false;
if(!array_safe_get(cache_result, frame, false)) return false;
return true;
}
@ -834,7 +839,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
return true;
}
static clearCache = function() {
return;
if(!use_cache) return;
if(array_length(cached_output) != ANIMATOR.frames_total + 1)
array_resize(cached_output, ANIMATOR.frames_total + 1);
@ -846,6 +851,12 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
cache_result[i] = false;
}
}
static clearCacheForward = function() {
clearCache();
for( var i = 0; i < ds_list_size(outputs); i++ )
for( var j = 0; j < ds_list_size(outputs[| i].value_to); j++ )
outputs[| i].value_to[| j].node.clearCacheForward();
}
static checkConnectGroup = function(_type = "group") {
var _y = y;
@ -1039,15 +1050,18 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
static postConnect = function() {}
static cleanUp = function() {
for( var i = 0; i < ds_list_size(inputs); i++ ) {
for( var i = 0; i < ds_list_size(inputs); i++ )
inputs[| i].cleanUp();
}
for( var i = 0; i < ds_list_size(outputs); i++ ) {
for( var i = 0; i < ds_list_size(outputs); i++ )
outputs[| i].cleanUp();
}
ds_list_destroy(inputs);
ds_list_destroy(outputs);
ds_map_destroy(attributes);
for( var i = 0; i < array_length(temp_surface); i++ )
surface_free(temp_surface[i]);
}
static onCleanUp = function() {}
}

View file

@ -15,7 +15,7 @@ function Node_Find_Pixel(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) c
static getPreviewValue = function() { return inputs[| 0]; }
surf = surface_create(1, 1);
temp_surface = [ surface_create(1, 1) ];
function process_data(_output, _data, _output_index, _array_index = 0) {
var _surf = _data[0];
@ -23,9 +23,9 @@ function Node_Find_Pixel(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) c
if(!is_surface(_surf)) return [0, 0];
surf = surface_verify(surf, 1, 1);
temp_surface[0] = surface_verify(temp_surface[0], 1, 1);
surface_set_target(surf);
surface_set_target(temp_surface[0]);
draw_clear_alpha(0, 0);
shader_set(shader);
texture_set_stage(shader_tex, surface_get_texture(_surf));
@ -34,7 +34,7 @@ function Node_Find_Pixel(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) c
shader_reset();
surface_reset_target();
var pos = surface_getpixel(surf, 0, 0);
var pos = surface_getpixel(temp_surface[0], 0, 0);
var _x = round(color_get_red(pos) / 255 * surface_get_width(_surf));
var _y = round(color_get_green(pos) / 255 * surface_get_height(_surf));

View file

@ -51,14 +51,8 @@ function Node_Image_Sequence(_x, _y, _group = -1) : Node(_x, _y, _group) constru
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Padding / Crop", "Scale" ])
.rejectArray();
inputs[| 4] = nodeValue("Edit", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
.setDisplay(VALUE_DISPLAY.button, [ function() {
with(dialogCall(o_dialog_image_array_edit, WIN_W / 2, WIN_H / 2))
target = other;
}, "Edit array" ]);
input_display_list = [
["Sequence settings", false], 4, 0, 1, 2, 3
["Array settings", false], 0, 1, 2, 3
];
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, []);

View file

@ -197,7 +197,7 @@ function valueAnimator(_val, _prop) constructor {
static setKeyTime = function(_key, _time, _replace = true) {
if(!ds_list_exist(values, _key)) return 0;
MODIFIED = true;
if(!LOADING) MODIFIED = true;
_time = max(_time, 0);
_key.setTime(_time);
@ -224,8 +224,6 @@ function valueAnimator(_val, _prop) constructor {
}
static setValue = function(_val = 0, _record = true, _time = ANIMATOR.current_frame, ease_in = 0, ease_out = 0) {
MODIFIED = true;
if(!is_anim) {
if(isEqual(values[| 0].value, _val))
return false;

View file

@ -19,6 +19,11 @@ function Node_Particle(_x, _y, _group = -1) : Node_VFX_Spawner_Base(_x, _y, _gro
def_surface = -1;
insp2UpdateTooltip = "Clear cache";
insp2UpdateIcon = [ THEME.cache, 0, COLORS._main_icon ];
static onInspector2Update = function() { clearCache(); }
static onValueUpdate = function(index = 0) {
if(index == input_len + 0) {
var _dim = inputs[| input_len + 0].getValue();
@ -27,12 +32,14 @@ function Node_Particle(_x, _y, _group = -1) : Node_VFX_Spawner_Base(_x, _y, _gro
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1]);
outputs[| 0].setValue(_outSurf);
}
if(ANIMATOR.is_playing)
ANIMATOR.setFrame(-1);
}
static onStep = function() {
if(!ANIMATOR.frame_progress) return;
RETURN_ON_REST
if(recoverCache() || !ANIMATOR.is_playing)
return;
if(ANIMATOR.current_frame == 0)
reset();
@ -67,6 +74,7 @@ function Node_Particle(_x, _y, _group = -1) : Node_VFX_Spawner_Base(_x, _y, _gro
BLEND_NORMAL;
surface_reset_target();
cacheCurrentFrame(_outSurf);
if(ANIMATOR.is_playing)
cacheCurrentFrame(_outSurf);
}
}

View file

@ -226,7 +226,7 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor {
addNodeObject(filter, "Corner", s_node_corner, "Node_Corner", [1, Node_Corner], ["round corner"]).set_version(1110);
addNodeObject(filter, "2D Light", s_node_2d_light, "Node_2D_light", [1, Node_2D_light]);
addNodeObject(filter, "Cast Shadow", s_node_shadow_cast, "Node_Shadow_Cast", [1, Node_Shadow_Cast]).set_version(1100);
addNodeObject(filter, "Pixel Expand", s_node_atlas, "Node_Atlas", [1, Node_Atlas]);
addNodeObject(filter, "Pixel Expand", s_node_atlas, "Node_Atlas", [1, Node_Atlas], ["atlas"]);
addNodeObject(filter, "Pixel Cloud", s_node_pixel_cloud, "Node_Pixel_Cloud", [1, Node_Pixel_Cloud]);
addNodeObject(filter, "Pixel Sort", s_node_pixel_sort, "Node_Pixel_Sort", [1, Node_Pixel_Sort]);
addNodeObject(filter, "Edge Detect", s_node_edge_detect, "Node_Edge_Detect", [1, Node_Edge_Detect]);
@ -497,6 +497,8 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor {
}
key = ds_map_find_next(NODE_MAP, key);
}
ds_map_clear(APPEND_MAP);
ds_map_clear(NODE_MAP);
ds_list_clear(NODES);
}

View file

@ -61,8 +61,6 @@ function Node_Scatter(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) cons
["Render", false], 11, 12, 16,
];
temp_surf = [ surface_create(1, 1), surface_create(1, 1) ];
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
if(process_amount > 1) return;
@ -127,7 +125,7 @@ function Node_Scatter(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) cons
var _posDist = [];
if(_dist == 2 && is_surface(_distMap))
_posDist = get_points_from_dist(_distMap, _amount);
_posDist = get_points_from_dist(_distMap, _amount, seed);
surface_set_target(_outSurf);
draw_clear_alpha(0, 0);

View file

@ -26,7 +26,7 @@ function Node_SDF(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) construc
["SDF", false], 2, 3,
]
pass = [ surface_create(1, 1), surface_create(1, 1) ];
temp_surface = [ surface_create(1, 1), surface_create(1, 1) ];
static process_data = function(_outSurf, _data, _output_index, _array_index) {
var inSurf = _data[0];
@ -36,11 +36,11 @@ function Node_SDF(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) construc
var sh = surface_get_height(inSurf);
var n = max(sw, sh);
pass[0] = surface_verify(pass[0], n, n);
pass[1] = surface_verify(pass[1], n, n);
temp_surface[0] = surface_verify(temp_surface[0], n, n);
temp_surface[1] = surface_verify(temp_surface[1], n, n);
_outSurf = surface_verify(_outSurf, sw, sh);
surface_set_target(pass[0]);
surface_set_target(temp_surface[0]);
draw_clear_alpha(0, 0);
BLEND_OVERRIDE;
@ -60,7 +60,7 @@ function Node_SDF(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) construc
stepSize /= 2;
bg = !bg;
surface_set_target(pass[bg]);
surface_set_target(temp_surface[bg]);
draw_clear_alpha(0, 0);
BLEND_OVERRIDE;
@ -68,7 +68,7 @@ function Node_SDF(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) construc
shader_set_uniform_f(uniform_sdf_dim, n, n );
shader_set_uniform_f(uniform_sdf_stp, stepSize);
shader_set_uniform_i(uniform_sdf_sid, _side);
draw_surface_safe(pass[!bg], 0, 0);
draw_surface_safe(temp_surface[!bg], 0, 0);
shader_reset();
BLEND_NORMAL;
@ -82,7 +82,7 @@ function Node_SDF(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) construc
shader_set(sh_sdf_dist);
shader_set_uniform_i(uniform_dst_sid, _side);
shader_set_uniform_f(uniform_dst_dst, _dist);
draw_surface_safe(pass[bg], 0, 0);
draw_surface_safe(temp_surface[bg], 0, 0);
shader_reset();
BLEND_NORMAL;

View file

@ -34,7 +34,7 @@ function Node_Seperate_Shape(_x, _y, _group = -1) : Node(_x, _y, _group) constru
["Render", false], 2, 3,
]
temp_surf = [ surface_create(1, 1), surface_create(1, 1) ];
temp_surface = [ surface_create(1, 1), surface_create(1, 1) ];
surface_buffer = buffer_create(1 * 1 * 4, buffer_fixed, 2);
surface_w = 1;
surface_h = 1;
@ -63,16 +63,16 @@ function Node_Seperate_Shape(_x, _y, _group = -1) : Node(_x, _y, _group) constru
surface_h = hh;
for(var i = 0; i < 2; i++) {
temp_surf[i] = surface_verify(temp_surf[i], ww, hh);
temp_surface[i] = surface_verify(temp_surface[i], ww, hh);
surface_set_target(temp_surf[i]);
surface_set_target(temp_surface[i]);
draw_clear_alpha(0, 0);
surface_reset_target();
}
shader_set(sh_seperate_shape_index);
shader_set_uniform_i(shader_get_uniform(sh_seperate_shape_index, "ignore"), _ignore);
surface_set_target(temp_surf[1]);
surface_set_target(temp_surface[1]);
draw_sprite_stretched(s_fx_pixel, 0, 0, 0, ww, hh);
surface_reset_target();
shader_reset();
@ -89,10 +89,10 @@ function Node_Seperate_Shape(_x, _y, _group = -1) : Node(_x, _y, _group) constru
var bg = i % 2;
var fg = !bg;
surface_set_target(temp_surf[bg]);
surface_set_target(temp_surface[bg]);
draw_clear_alpha(0, 0);
BLEND_OVERRIDE;
draw_surface_safe(temp_surf[fg], 0, 0);
draw_surface_safe(temp_surface[fg], 0, 0);
BLEND_NORMAL;
surface_reset_target();
@ -106,7 +106,7 @@ function Node_Seperate_Shape(_x, _y, _group = -1) : Node(_x, _y, _group) constru
draw_clear_alpha(0, 0);
BLEND_OVERRIDE;
shader_set(sh_seperate_shape_counter);
texture_set_stage(shader_get_sampler_index(sh_seperate_shape_counter, "surface"), surface_get_texture(temp_surf[res_index]));
texture_set_stage(shader_get_sampler_index(sh_seperate_shape_counter, "surface"), surface_get_texture(temp_surface[res_index]));
shader_set_uniform_f_array_safe(shader_get_uniform(sh_seperate_shape_counter, "dimension"), [ ww, hh ]);
shader_set_uniform_i(shader_get_uniform(sh_seperate_shape_counter, "maxShape"), PREF_MAP[? "shape_separation_max"]);
shader_set_uniform_i(shader_get_uniform(sh_seperate_shape_counter, "ignore"), _ignore);
@ -127,7 +127,7 @@ function Node_Seperate_Shape(_x, _y, _group = -1) : Node(_x, _y, _group) constru
buffer_delete(surface_buffer);
surface_buffer = buffer_create(ww * hh * 4, buffer_fixed, 2);
buffer_get_surface(surface_buffer, temp_surf[res_index], 0);
buffer_get_surface(surface_buffer, temp_surface[res_index], 0);
for(var i = 0; i < px; i++) {
_outSurf = surface_create_valid(ww, hh);
@ -170,7 +170,7 @@ function Node_Seperate_Shape(_x, _y, _group = -1) : Node(_x, _y, _group) constru
shader_set_uniform_f(shader_get_uniform(sh_seperate_shape_sep, "color"), red, green, blue, alpha);
shader_set_uniform_i(shader_get_uniform(sh_seperate_shape_sep, "override"), _ovr);
shader_set_uniform_f_array_safe(shader_get_uniform(sh_seperate_shape_sep, "overColor"), colToVec4(_ovrclr));
draw_surface_safe(temp_surf[res_index], 0, 0);
draw_surface_safe(temp_surface[res_index], 0, 0);
shader_reset();
BLEND_NORMAL;
surface_reset_target();

View file

@ -81,7 +81,7 @@ function Node_Shadow_Cast(_x, _y, _group = -1) : Node_Processor(_x, _y, _group)
.setDisplay(VALUE_DISPLAY.slider, [0, 16, 1]);
inputs[| 16] = nodeValue("Ambient occlusion strength", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.1)
.setDisplay(VALUE_DISPLAY.slider, [0, 0.2, 0.01]);
.setDisplay(VALUE_DISPLAY.slider, [0, 0.5, 0.01]);
inputs[| 17] = nodeValue("Active", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true);
active_index = 17;

View file

@ -6,6 +6,8 @@ function Node_Trail(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
uni_dimension = shader_get_uniform(shader1, "dimension");
uni_mode = shader_get_uniform(shader1, "mode");
uni_range = shader_get_uniform(shader1, "range");
uni_colr = shader_get_uniform(shader1, "matchColor");
uni_blend = shader_get_uniform(shader1, "blendColor");
uni_seg_st = shader_get_uniform(shader1, "segmentStart");
uni_seg_sz = shader_get_uniform(shader1, "segmentSize");
uni_sam_prev = shader_get_sampler_index(shader1, "prevFrame");
@ -15,11 +17,17 @@ function Node_Trail(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
inputs[| 1] = nodeValue("Max life", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 5);
inputs[| 1] = nodeValue("Max life", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 5);
inputs[| 2] = nodeValue("Loop", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false);
inputs[| 2] = nodeValue("Loop", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false);
inputs[| 3] = nodeValue("Max distance", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, -1);
inputs[| 3] = nodeValue("Max distance", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, -1, "Maximum distance to search for movement, set to -1 to search the entire image.");
inputs[| 4] = nodeValue("Match color", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true, "Make trail track pixels of the same color, instead of the closet pixels.");
inputs[| 5] = nodeValue("Blend color", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true, "Blend color between two pixel smoothly.");
inputs[| 6] = nodeValue("Alpha over life", self, JUNCTION_CONNECT.input, VALUE_TYPE.curve, CURVE_DEF_11);
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
@ -27,10 +35,18 @@ function Node_Trail(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
input_display_list = [
["Surface", true], 0,
["Trail settings", false], 1, 3, 2
["Trail settings", false], 1, 2,
["Tracking", false], 3, 4, 5,
["Modification", false], 6,
];
temp = [ surface_create(1, 1), surface_create(1, 1), surface_create(1, 1) ];
temp_surface = [ surface_create(1, 1), surface_create(1, 1), surface_create(1, 1) ];
static step = function() {
var _colr = inputs[| 4].getValue();
inputs[| 5].setVisible(!_colr);
}
static update = function() {
if(!inputs[| 0].value_from) return;
@ -40,13 +56,16 @@ function Node_Trail(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
var _life = inputs[| 1].getValue();
var _loop = inputs[| 2].getValue();
var _rang = inputs[| 3].getValue();
var _colr = inputs[| 4].getValue();
var _blend = inputs[| 5].getValue();
var _alpha = inputs[| 6].getValue();
if(!is_surface(_surf)) return;
cacheCurrentFrame(_surf);
for( var i = 0; i < array_length(temp); i++ ) {
temp[i] = surface_verify(temp[i], surface_get_width(_surf), surface_get_height(_surf));
surface_set_target(temp[i]);
for( var i = 0; i < array_length(temp_surface); i++ ) {
temp_surface[i] = surface_verify(temp_surface[i], surface_get_width(_surf), surface_get_height(_surf));
surface_set_target(temp_surface[i]);
draw_clear_alpha(0, 0);
surface_reset_target();
}
@ -70,58 +89,64 @@ function Node_Trail(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
if(_loop && frame_idx < 0) frame_idx = ANIMATOR.frames_total + frame_idx;
var prev = _loop? safe_mod(frame_idx - 1 + ANIMATOR.frames_total, ANIMATOR.frames_total) : frame_idx - 1;
if(!is_surface(getCacheFrame(frame_idx))) continue;
var _prevFrame = getCacheFrame(prev);
var _currFrame = getCacheFrame(frame_idx);
if(!is_surface(getCacheFrame(prev))) {
surface_set_target(temp[0]);
draw_surface(getCacheFrame(frame_idx), 0, 0);
if(!is_surface(_currFrame)) continue;
if(!is_surface(_prevFrame)) {
surface_set_target(temp_surface[0]);
draw_surface(_currFrame, 0, 0);
surface_reset_target();
surface_set_target(temp[2]);
draw_surface(getCacheFrame(frame_idx), 0, 0);
surface_set_target(temp_surface[2]);
draw_surface(_currFrame, 0, 0);
surface_reset_target();
continue;
}
shader_set(shader1);
shader_set_uniform_f(uni_dimension, surface_get_width(_surf), surface_get_height(_surf));
shader_set_uniform_f(uni_range, _rang? _rang : surface_get_width(_surf) / 2);
shader_set_uniform_f(uni_range, _rang? _rang : surface_get_width(_surf) * 1.5);
shader_set_uniform_i(uni_colr, _colr);
shader_set_uniform_i(uni_blend, _blend);
shader_set_uniform_f(uni_seg_st, (frame_amo - i) / frame_amo);
shader_set_uniform_f(uni_seg_sz, 1 / frame_amo);
texture_set_stage(uni_sam_prev, surface_get_texture(getCacheFrame(prev)));
texture_set_stage(uni_sam_prev, surface_get_texture(_prevFrame));
shader_set_uniform_i(uni_mode, 1);
surface_set_target(temp[0]);
draw_surface(getCacheFrame(frame_idx), 0, 0);
surface_set_target(temp_surface[0]);
draw_surface(_currFrame, 0, 0);
surface_reset_target();
shader_set_uniform_i(uni_mode, 0);
surface_set_target(temp[2]);
draw_surface(getCacheFrame(frame_idx), 0, 0);
surface_set_target(temp_surface[2]);
draw_surface(_currFrame, 0, 0);
surface_reset_target();
shader_reset();
}
surface_set_target(temp[1]);
surface_set_target(temp_surface[1]);
shader_set(shader2);
shader_set_uniform_f(uni2_dimension, surface_get_width(_surf), surface_get_height(_surf));
draw_surface(temp[0], 0, 0);
draw_surface(temp_surface[0], 0, 0);
shader_reset();
surface_reset_target();
surface_set_target(_outUV);
draw_clear_alpha(0, 0);
BLEND_ALPHA;
draw_surface_safe(temp[1], 0, 0);
draw_surface_safe(temp_surface[1], 0, 0);
BLEND_NORMAL;
surface_reset_target();
surface_set_target(_outSurf);
draw_clear_alpha(0, 0);
BLEND_ALPHA;
draw_surface_safe(temp[2], 0, 0);
draw_surface_safe(temp_surface[2], 0, 0);
BLEND_NORMAL;
surface_reset_target();
}
}

View file

@ -419,6 +419,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
switch(display_type) {
case VALUE_DISPLAY._default :
editWidget = new textBox(_txt, function(val) {
MODIFIED = true;
return setValueDirect(val);
} );
editWidget.slidable = true;
@ -429,6 +430,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
break;
case VALUE_DISPLAY.range :
editWidget = new rangeBox(_txt, function(index, val) {
MODIFIED = true;
var _val = animator.getValue();
_val[index] = val;
return setValueDirect(_val);
@ -442,6 +444,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
var val = animator.getValue();
if(array_length(val) <= 4) {
editWidget = new vectorBox(array_length(animator.getValue()), _txt, function(index, val) {
MODIFIED = true;
var _val = animator.getValue();
_val[index] = val;
return setValueDirect(_val);
@ -461,6 +464,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
var val = animator.getValue();
editWidget = new vectorRangeBox(array_length(val), _txt, function(index, val) {
MODIFIED = true;
var _val = animator.getValue();
_val[index] = val;
return setValueDirect(_val);
@ -477,6 +481,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
break;
case VALUE_DISPLAY.rotation :
editWidget = new rotator(function(val, _save) {
MODIFIED = true;
return setValueDirect(val, _save);
}, display_data );
@ -484,6 +489,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
break;
case VALUE_DISPLAY.rotation_range :
editWidget = new rotatorRange(function(index, val) {
MODIFIED = true;
var _val = animator.getValue();
_val[index] = round(val);
return setValueDirect(_val);
@ -493,6 +499,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
break;
case VALUE_DISPLAY.slider :
editWidget = new slider(display_data[0], display_data[1], display_data[2], function(val) {
MODIFIED = true;
return setValueDirect(toNumber(val));
} );
if(type == VALUE_TYPE.integer) editWidget.setSlideSpeed(1);
@ -501,6 +508,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
break;
case VALUE_DISPLAY.slider_range :
editWidget = new sliderRange(display_data[0], display_data[1], display_data[2], function(index, val) {
MODIFIED = true;
var _val = animator.getValue();
_val[index] = val;
return setValueDirect(_val);
@ -511,6 +519,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
break;
case VALUE_DISPLAY.area :
editWidget = new areaBox(function(index, val) {
MODIFIED = true;
var _val = animator.getValue();
_val[index] = val;
return setValueDirect(_val);
@ -522,6 +531,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
break;
case VALUE_DISPLAY.padding :
editWidget = new paddingBox(function(index, val) {
MODIFIED = true;
var _val = animator.getValue();
_val[index] = val;
return setValueDirect(_val);
@ -533,6 +543,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
break;
case VALUE_DISPLAY.puppet_control :
editWidget = new controlPointBox(function(index, val) {
MODIFIED = true;
var _val = animator.getValue();
_val[index] = val;
return setValueDirect(_val);
@ -542,6 +553,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
break;
case VALUE_DISPLAY.enum_scroll :
editWidget = new scrollBox(display_data, function(val) {
MODIFIED = true;
if(val == -1) return;
return setValueDirect(toNumber(val));
} );
@ -551,6 +563,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
break;
case VALUE_DISPLAY.enum_button :
editWidget = buttonGroup(display_data, function(val) {
MODIFIED = true;
return setValueDirect(val);
} );
@ -559,6 +572,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
break;
case VALUE_DISPLAY.kernel :
editWidget = new matrixGrid(_txt, function(index, val) {
MODIFIED = true;
var _val = animator.getValue();
_val[index] = val;
return setValueDirect(_val);
@ -572,6 +586,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
break;
case VALUE_TYPE.boolean :
editWidget = new checkBox(function() {
MODIFIED = true;
return setValueDirect(!animator.getValue());
} );
@ -581,6 +596,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
switch(display_type) {
case VALUE_DISPLAY._default :
editWidget = buttonColor(function(color) {
MODIFIED = true;
return setValueDirect(color);
} );
@ -588,6 +604,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
break;
case VALUE_DISPLAY.gradient :
editWidget = buttonGradient(function(gradient) {
MODIFIED = true;
return setValueDirect(gradient);
} );
@ -597,6 +614,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
break;
case VALUE_DISPLAY.palette :
editWidget = buttonPalette(function(color) {
MODIFIED = true;
return setValueDirect(color);
} );
@ -607,17 +625,12 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
case VALUE_TYPE.path :
switch(display_type) {
case VALUE_DISPLAY.path_array :
editWidget = button(function() {
var path = get_open_filenames(display_data[0], display_data[1]);
if(path == "") return noone;
var paths = string_splice(path, "\n");
return setValueDirect(paths);
});
editWidget = new pathArrayBox(node, display_data, function(path) { setValueDirect(path); } );
break;
case VALUE_DISPLAY.path_load :
editWidget = new textBox(TEXTBOX_INPUT.text, function(str) { setValueDirect(str); },
button(function() {
MODIFIED = true;
var path = get_open_filename(display_data[0], display_data[1]);
if(path == "") return noone;
return setValueDirect(path);
@ -630,6 +643,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
case VALUE_DISPLAY.path_save :
editWidget = new textBox(TEXTBOX_INPUT.text, function(str) { setValueDirect(str); },
button(function() {
MODIFIED = true;
var path = get_save_filename(display_data[0], display_data[1]);
if(path == "") return noone;
return setValueDirect(path);
@ -643,6 +657,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
case VALUE_DISPLAY.path_font :
editWidget = new fontScrollBox(
function(val) {
MODIFIED = true;
return setValueDirect(DIRECTORY + "Fonts\\" + FONT_INTERNAL[val]);
}
);
@ -652,6 +667,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
case VALUE_TYPE.curve :
display_type = VALUE_DISPLAY.curve;
editWidget = new curveBox(function(_modified) {
MODIFIED = true;
return setValueDirect(_modified);
});
break;
@ -659,6 +675,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
switch(display_type) {
case VALUE_DISPLAY._default :
editWidget = new textArea(TEXTBOX_INPUT.text, function(str) {
MODIFIED = true;
return setValueDirect(str);
});
extract_node = "Node_String";
@ -666,6 +683,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
case VALUE_DISPLAY.code :
editWidget = new textArea(TEXTBOX_INPUT.text, function(str) {
MODIFIED = true;
return setValueDirect(str);
});
@ -676,12 +694,16 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
break;
case VALUE_DISPLAY.text_array :
editWidget = new textArrayBox(function() { return animator.values[| 0].value; }, display_data, function() { node.update(); });
editWidget = new textArrayBox(function() {
MODIFIED = true;
return animator.values[| 0].value; }, display_data, function() { node.update();
});
break;
}
break;
case VALUE_TYPE.surface :
editWidget = new surfaceBox(function(ind) {
MODIFIED = true;
return setValueDirect(ind);
}, display_data );
show_in_inspector = true;
@ -982,9 +1004,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
node.valueUpdate(index);
}
if(node.use_cache)
node.clearCache();
MODIFIED = true;
node.clearCacheForward();
cache_array[0] = false;
cache_value[0] = false;
}
@ -1073,13 +1093,13 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
if(_update && connect_type == JUNCTION_CONNECT.input) {
node.onValueFromUpdate(index);
node.triggerRender();
if(node.use_cache) node.clearCache();
node.clearCacheForward();
}
cache_array[0] = false;
cache_value[0] = false;
MODIFIED = true;
if(!LOADING) MODIFIED = true;
return true;
}
@ -1186,7 +1206,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
case VALUE_DISPLAY.vector :
var _spr = argument_count > 8? argument[8] : THEME.anchor_selector;
var _sca = argument_count > 9? argument[9] : 1;
return preview_overlay_vector(active, _x, _y, _s, _mx, _my, _snx, _sny, _spr, _sca);
return preview_overlay_vector(active, _x, _y, _s, _mx, _my, _snx, _sny, _spr);
case VALUE_DISPLAY.area :
return preview_overlay_area(active, _x, _y, _s, _mx, _my, _snx, _sny, display_data);
@ -1205,7 +1225,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
var ss = max(0.25, _s / 2);
var is_hover = false;
if(point_in_circle(_mx, _my, x, y, 10 * _s)) {
if(PANEL_GRAPH.pHOVER && point_in_circle(_mx, _my, x, y, 10 * _s)) {
is_hover = true;
draw_sprite_ext(isArray()? THEME.node_junctions_array_hover : THEME.node_junctions_single_hover, type, x, y, ss, ss, 0, c_white, 1);
} else {
@ -1234,7 +1254,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
static drawName = function(_s, _mx, _my) {
if(!isVisible()) return false;
var _hover = point_in_circle(_mx, _my, x, y, 10 * _s);
var _hover = PANEL_GRAPH.pHOVER && point_in_circle(_mx, _my, x, y, 10 * _s);
var _draw_cc = _hover? COLORS._main_text : COLORS._main_text_sub;
draw_set_text(f_p1, fa_left, fa_center, _draw_cc);
@ -1389,6 +1409,13 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
return false;
}
static destroy = function() {
if(error_notification != noone) {
noti_remove(error_notification);
error_notification = noone;
}
}
static cleanUp = function() {
ds_list_destroy(value_to);
ds_list_destroy(extra_data);

View file

@ -212,10 +212,11 @@ function Panel_Collection() : PanelContent() constructor {
}
draw_set_text(f_p2, fa_center, fa_top, COLORS._main_text);
name_height = max(name_height, string_height_ext(_node.name, -1, grid_size) + 8);
name_height = max(name_height, string_height_ext(_node.name, -1, grid_width) + 8);
draw_text_ext_over(_boxx + grid_size / 2, yy + grid_size + ui(4), _node.name, -1, grid_width);
}
var hght = grid_size + grid_space + name_height;
var hght = grid_size + name_height + ui(8);
hh += hght;
yy += hght;
}

View file

@ -10,6 +10,7 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
parent = _parent;
if(parent) ds_list_add(parent.childs, self);
padding = ui(2);
content = noone;
childs = ds_list_create();
anchor = ANCHOR.none;
@ -33,12 +34,17 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
surface_set_target(mask_surface);
draw_clear(c_black);
gpu_set_blendmode(bm_subtract);
draw_sprite_stretched(THEME.ui_panel_bg, 0, ui(2), ui(2), w - ui(4), h - ui(4));
draw_sprite_stretched(THEME.ui_panel_bg, 0, padding, padding, w - padding * 2, h - padding * 2);
gpu_set_blendmode(bm_normal);
surface_reset_target();
}
resetMask();
function setPadding(padding) {
self.padding = padding;
resetMask();
}
function refresh() {
if(is_surface(content_surface) && surface_exists(content_surface))
surface_size_to(content_surface, w, h);
@ -354,7 +360,7 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
function drawPanel() {
if(w <= ui(16)) return;
draw_sprite_stretched(THEME.ui_panel_bg, 0, x + ui(2), y + ui(2), w - ui(4), h - ui(4));
draw_sprite_stretched(THEME.ui_panel_bg, 0, x + padding, y + padding, w - padding * 2, h - padding * 2);
if(!is_surface(mask_surface)) {
mask_surface = surface_create_valid(w, h);
@ -379,7 +385,7 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
draw_surface_safe(content_surface, x, y);
if(FOCUS == self)
draw_sprite_stretched_ext(THEME.ui_panel_active, 0, x + ui(2), y + ui(2), w - ui(4), h - ui(4), COLORS._main_accent, 1);
draw_sprite_stretched_ext(THEME.ui_panel_active, 0, x + padding, y + padding, w - padding * 2, h - padding * 2, COLORS._main_accent, 1);
}
function remove() {

View file

@ -38,7 +38,7 @@
}
function setPanel() {
PANEL_MAIN = new Panel(noone, 0, 0, WIN_SW, WIN_SH);
PANEL_MAIN = new Panel(noone, ui(2), ui(2), WIN_SW - ui(4), WIN_SH - ui(4));
PANEL_MENU = new Panel_Menu();
PANEL_INSPECTOR = new Panel_Inspector();

View file

@ -420,27 +420,8 @@ function Panel_Inspector() : PanelContent() constructor {
switch(jun.display_type) {
case VALUE_DISPLAY.path_load :
case VALUE_DISPLAY.path_save :
jun.editWidget.draw(editBoxX, editBoxY, editBoxW, editBoxH, jun.showValue(), _m);
break;
case VALUE_DISPLAY.path_array :
var val = jun.showValue(), txt = "";
var pathExist = jun.value_validation == VALIDATION.pass;
if(is_array(val) && array_length(val))
txt = "[" + string(array_length(val)) + "] " + val[0];
else
txt = string(val);
jun.editWidget.draw(editBoxX, editBoxY, editBoxW, editBoxH, _m,, pathExist? COLORS._main_text : COLORS._main_value_negative);
var icx = editBoxX + editBoxW - ui(16);
var icy = editBoxY + editBoxH / 2;
draw_sprite_ui_uniform(pathExist? THEME.button_path_icon : THEME.button_path_not_found_icon, 0, icx, icy, 1,, 1);
draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text);
draw_text_cut(editBoxX + ui(8), editBoxY + editBoxH / 2, txt, editBoxW - ui(60));
if(!pathExist && _hover && point_in_rectangle(_m[0], _m[1], icx - ui(17), icy - ui(17), icx + ui(17), icy + ui(17)))
TOOLTIP = get_text("panel_inspector_file_not_exist", "File not exist");
jun.editWidget.draw(editBoxX, editBoxY, editBoxW, editBoxH, jun.showValue(), _m);
break;
case VALUE_DISPLAY.path_font :
var val = jun.showValue();

View file

@ -37,6 +37,14 @@ function Panel_Menu() : PanelContent() constructor {
})
]);
}, THEME.addon ).setIsShelf(),
-1,
menuItem(get_text("fullscreen", "Toggle fullscreen"), function() {
if(gameframe_is_fullscreen_window())
gameframe_set_fullscreen(0);
else
gameframe_set_fullscreen(2);
},, ["", "Fullscreen"]),
menuItem(get_text("exit", "Close program"), function() { window_close(); }),
];
if(DEMO) array_delete(menu_file, 1, 4);
@ -242,12 +250,12 @@ function Panel_Menu() : PanelContent() constructor {
draw_sprite_stretched(THEME.menu_button, 0, xc - ww / 2, ui(6), ww, h - ui(12));
if((mouse_press(mb_left, pFOCUS)) || instance_exists(o_dialog_menubox)) {
menuCall( x + xx, y + h, menus[i][1]);
menuCall( xx, h, menus[i][1]);
}
}
draw_set_text(f_p1, fa_center, fa_center, COLORS._main_text);
draw_text_over(xx + ww / 2, y + h / 2, menus[i][0]);
draw_text_over(xx + ww / 2, h / 2, menus[i][0]);
xx += ww + 8;
}
@ -257,7 +265,7 @@ function Panel_Menu() : PanelContent() constructor {
var error_amo = ds_list_size(ERRORS);
var nx0 = xx + ui(24);
var ny0 = y + h / 2;
var ny0 = h / 2;
draw_set_text(f_p0, fa_left, fa_center);
var wr_w = ui(20) + ui(8) + string_width(string(warning_amo));
@ -331,34 +339,42 @@ function Panel_Menu() : PanelContent() constructor {
var bs = ui(28);
if(buttonInstant(THEME.button_hide_fill, x1 - bs, ui(6), bs, bs, [mx, my], pFOCUS, pHOVER,, THEME.window_exit, 0, COLORS._main_accent) == 2) {
game_end();
window_close();
}
x1 -= bs + ui(8);
x1 -= bs + ui(4);
if(buttonInstant(THEME.button_hide_fill, x1 - bs, ui(6), bs, bs, [mx, my], pFOCUS, pHOVER,, THEME.window_maximize, window_is_maximize(), COLORS._main_icon) == 2) {
if(window_is_maximize())
window_restore();
var win_max = gameframe_is_maximized() || gameframe_is_fullscreen_window();
if(buttonInstant(THEME.button_hide_fill, x1 - bs, ui(6), bs, bs, [mx, my], pFOCUS, pHOVER,, THEME.window_maximize, win_max, [ COLORS._main_icon, CDEF.lime ]) == 2) {
if(gameframe_is_fullscreen_window()) {
gameframe_set_fullscreen(0);
gameframe_restore();
} else if(gameframe_is_maximized())
gameframe_restore();
else
maximize_window();
gameframe_maximize();
}
x1 -= bs + ui(8);
x1 -= bs + ui(4);
if(buttonInstant(THEME.button_hide_fill, x1 - bs, ui(6), bs, bs, [mx, my], pFOCUS, pHOVER,, THEME.window_minimize, 0, COLORS._main_icon) == 2) {
//minimize_window();
window_set_position(0, 0);
if(buttonInstant(THEME.button_hide_fill, x1 - bs, ui(6), bs, bs, [mx, my], pFOCUS, pHOVER,, THEME.window_minimize, 0, [ COLORS._main_icon, CDEF.yellow ]) == -2) {
gameframe_minimize();
}
x1 -= bs + ui(8);
x1 -= bs + ui(4);
if(buttonInstant(THEME.button_hide_fill, x1 - bs, ui(6), bs, bs, [mx, my], pFOCUS, pHOVER,, THEME.window_fullscreen, gameframe_is_fullscreen_window(), [ COLORS._main_icon, CDEF.cyan ]) == 2) {
if(gameframe_is_fullscreen_window())
gameframe_set_fullscreen(0);
else
gameframe_set_fullscreen(2);
}
x1 -= bs + ui(4);
#endregion
#region version
draw_set_text(f_p0, fa_right, fa_center, COLORS._main_text_sub);
var txt = "v. " + string(VERSION_STRING);
if(DEMO) txt += " DEMO";
var ww = string_width(txt) + ui(12);
if(pHOVER && point_in_rectangle(mx, my, x1 - ww, 0, x1, h)) {
draw_sprite_stretched(THEME.menu_button, 0, x1 - ww, ui(6), ww, h - ui(12));
draw_sprite_stretched(THEME.button_hide_fill, 1, x1 - ww, ui(6), ww, h - ui(12));
if(mouse_press(mb_left, pFOCUS)) {
dialogCall(o_dialog_release_note);
@ -370,6 +386,40 @@ function Panel_Menu() : PanelContent() constructor {
displayNewVersion();
#endregion
#region title
var txt = "";
if(CURRENT_PATH == "")
txt = "Untitled";
else
txt = filename_name(CURRENT_PATH);
if(MODIFIED)
txt += "*";
txt += " - Pixel Composer";
if(DEMO) txt += " DEMO";
var tx0 = nx0;
var tx1 = x1 - ww;
var maxW = abs(tx0 - tx1);
var tcx = (tx0 + tx1) / 2;
draw_set_font(f_p0b);
var tc = string_cut(txt, maxW);
var tw = string_width(tc) + ui(16);
if(buttonInstant(THEME.button_hide_fill, tcx - tw / 2, h / 2 - ui(14), tw, ui(28), [mx, my], pFOCUS, pHOVER) == 2) {
var arr = [];
for(var i = 0; i < min(10, ds_list_size(RECENT_FILES)); i++) {
var _rec = RECENT_FILES[| i];
array_push(arr, menuItem(_rec, function(_x, _y, _depth, _path) { LOAD_PATH(_path); }));
}
var dia = menuCall(tcx, h, arr, fa_center);
}
draw_set_text(f_p0b, fa_center, fa_center, COLORS._main_text_sub);
draw_text(tcx, h / 2, tc);
#endregion
undoUpdate();
}
}

View file

@ -0,0 +1,67 @@
function pathArrayBox(_target, _data, _onClick) : widget() constructor {
target = _target;
data = _data;
onClick = _onClick;
openPath = button(function() {
var path = get_open_filenames(data[0], data[1]);
if(path == "") return noone;
var paths = string_splice(path, "\n");
onClick(paths);
}, THEME.button_path_icon);
static trigger = function() {
with(dialogCall(o_dialog_image_array_edit, WIN_W / 2, WIN_H / 2))
target = other.target;
}
static draw = function(_x, _y, _w, _h, _files, _m) {
x = _x;
y = _y;
w = _w;
h = _h;
openPath.hover = hover;
openPath.active = active;
openPath.draw(_x + _w - ui(32), _y + _h / 2 - ui(32 / 2), ui(32), ui(32), _m, THEME.button_hide);
_w -= ui(40);
var click = false;
draw_sprite_stretched(THEME.textbox, 3, _x, _y, _w, _h);
if(hover && point_in_rectangle(_m[0], _m[1], _x, _y, _x + _w, _y + _h)) {
draw_sprite_stretched(THEME.textbox, 1, _x, _y, _w, _h);
if(mouse_press(mb_left, active)) {
trigger();
click = true;
}
if(mouse_click(mb_left, active))
draw_sprite_stretched(THEME.textbox, 2, _x, _y, _w, _h);
} else {
draw_sprite_stretched(THEME.textbox, 0, _x, _y, _w, _h);
if(mouse_press(mb_left)) deactivate();
}
var aa = interactable * 0.25 + 0.75;
if(!is_array(_files)) _files = [ _files ];
var len = array_length(_files);
var txt = "(" + string(len) + ") " + "[";
for( var i = 0; i < array_length(_files); i++ )
txt += (i? ", " : "") + filename_name_only(_files[i]);
txt += "]";
draw_set_alpha(aa);
draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text);
draw_text_cut(_x + ui(8), _y + _h / 2, txt, _w - ui(16));
draw_set_alpha(1);
if(WIDGET_CURRENT == self)
draw_sprite_stretched(THEME.widget_selecting, 0, _x - ui(3), _y - ui(3), _w + ui(6), _h + ui(6));
resetFocus();
return click;
}
}

View file

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

View file

@ -1,4 +1,10 @@
function point_rotate(px, py, ox, oy, a) {
a = angle_difference(a, 0);
if(a == 0) return [ px, py ];
if(a == 180) return [ ox + (ox - px), oy + (oy - py) ];
if(a == 90) return [ ox + (oy - py), oy + (ox - px) ];
if(a == -90) return [ ox + (py - oy), oy + (px - ox) ];
var cx = px - ox;
var cy = py - oy;
var d = -degtorad(a);

View file

@ -56,6 +56,9 @@
PREF_MAP[? "auto_save_time"] = 300;
PREF_MAP[? "use_legacy_exception"] = false;
PREF_MAP[? "dialog_add_node_w"] = 532;
PREF_MAP[? "dialog_add_node_h"] = 400;
#endregion
#region hotkeys
@ -172,7 +175,9 @@
ds_map_add_list(map, "key", save_l);
PREF_MAP[? "window_maximize"] = window_is_maximize();
PREF_MAP[? "window_maximize"] = gameframe_is_maximized();
PREF_MAP[? "window_width"] = gameframe_restoreRect_hx[2];
PREF_MAP[? "window_height"] = gameframe_restoreRect_hx[3];
var _pref = ds_map_create();
ds_map_override(_pref, PREF_MAP);
@ -234,17 +239,16 @@
setException();
}
if(PREF_MAP[? "window_maximize"]) {
run_in(1, function() {
window_set_size(PREF_MAP[? "window_width"], PREF_MAP[? "window_height"]);
run_in(15, function() { maximize_window(); });
});
} else {
var ww = PREF_MAP[? "window_width"];
var hh = PREF_MAP[? "window_height"];
if(!LOADING) {
if(PREF_MAP[? "window_maximize"]) {
gameframe_maximize();
} else {
var ww = PREF_MAP[? "window_width"];
var hh = PREF_MAP[? "window_height"];
window_set_position(display_get_width() / 2 - ww / 2, display_get_height() / 2 - hh / 2);
window_set_size(ww, hh);
window_set_position(display_get_width() / 2 - ww / 2, display_get_height() / 2 - hh / 2);
window_set_size(ww, hh);
}
}
game_set_speed(PREF_MAP[? "ui_framerate"], gamespeed_fps);

View file

@ -1,12 +1,21 @@
function NEW() {
if(MODIFIED && !READONLY) {
var dia = dialogCall(o_dialog_load);
dia.newFile = true;
} else
__NEW();
}
function __NEW() {
nodeCleanUp();
setPanel();
instance_destroy(_p_dialog);
room_restart();
//room_restart();
gc_collect();
SET_PATH("");
MODIFIED = false;
SAFE_MODE = false;
}

View file

@ -50,3 +50,8 @@ function string_real(val) {
return string_format(val, -1, pres);
}
function filename_name_only(name) {
name = filename_name(name);
return string_replace(name, filename_ext(name), "")
}

View file

@ -0,0 +1,8 @@
function window_close() {
if(MODIFIED && !READONLY) {
dialogCall(o_dialog_exit);
} else {
PREF_SAVE();
game_end();
}
}

View file

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

View file

@ -20,16 +20,24 @@ void main() {
if(col.a == 1.)
return;
float tauDiv = TAU / angle_sample;
for(float i = 1.; i <= distance_sample; i++)
for(float j = 0.; j < angle_sample; j++) {
float ang = j * tauDiv;
vec2 pxs = (pixelPosition + vec2( cos(ang), sin(ang)) * scale * i) / dimension;
vec4 sam = texture2D( gm_BaseTexture, pxs );
for(float i = 1.; i <= distance_sample; i++) {
float base = 1.;
float top = 0.;
for(float j = 0.; j <= 64.; j++) {
float ang = top / base * TAU;
top += 2.;
if(top >= base) {
top = 1.;
base *= 2.;
}
if(sam.a < 1.) continue;
vec2 pxs = (pixelPosition + vec2( cos(ang), sin(ang)) * scale * i) / dimension;
vec4 sam = texture2D( gm_BaseTexture, pxs );
gl_FragColor = sam;
return;
if(sam.a < 1.) continue;
gl_FragColor = sam;
return;
}
}
}

View file

@ -4,21 +4,20 @@
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
#define TAU 6.283185307179586
uniform vec2 dimension;
uniform vec2 scale;
uniform vec2 shift;
uniform float height;
uniform int slope;
#define TAU 6.28318
float bright(in vec4 col) {
return (col.r + col.g + col.b) / 3. * col.a;
}
void main() {
vec2 pixelStep = 1. / dimension;
float tauDiv = TAU / 32.;
vec4 col = texture2D(gm_BaseTexture, v_vTexcoord);
vec4 col1;
@ -34,12 +33,20 @@ void main() {
if(b0 == 0.) return;
float b1 = b0;
float ang, added_distance, _b1;
float added_distance, _b1;
vec2 shf, pxs;
for(float i = 1.; i < height; i++) {
for(float j = 0.; j < 32.; j++) {
ang = j * tauDiv;
float base = 1.;
float top = 0.;
for(float j = 0.; j <= 64.; j++) {
float ang = top / base * TAU;
top += 2.;
if(top >= base) {
top = 1.;
base *= 2.;
}
added_distance = 1. + cos(abs(shift_angle - ang)) * shift_distance;
shf = vec2( cos(ang), sin(ang)) * (i * added_distance) / scale;

View file

@ -17,7 +17,7 @@ uniform float radiusScale;
uniform float radiusShatter;
#define PI 3.14159265359
#define TAU 6.28318
#define TAU 6.283185307179586
vec2 random2( vec2 p ) {
return fract(sin(vec2(dot(p, vec2(127.1, 311.7)), dot(p, vec2(269.5, 183.3)))) * 43758.5453);

View file

@ -14,7 +14,7 @@ uniform float radiusScale;
uniform float radiusShatter;
uniform int pattern;
#define TAU 6.28318
#define TAU 6.283185307179586
vec2 random2( vec2 p ) {
return fract(sin(vec2(dot(p, vec2(127.1, 311.7)), dot(p, vec2(269.5, 183.3)))) * 43758.5453);

View file

@ -14,7 +14,7 @@ uniform float radiusScale;
uniform float radiusShatter;
uniform int pattern;
#define TAU 6.28318
#define TAU 6.283185307179586
vec2 random2( vec2 p ) {
return fract(sin(vec2(dot(p, vec2(127.1, 311.7)), dot(p, vec2(269.5, 183.3)))) * 43758.5453);

View file

@ -7,11 +7,10 @@ varying vec4 v_vColour;
uniform vec2 dimension;
uniform float rad;
#define TAU 6.28318
#define TAU 6.283185307179586
void main() {
vec2 pixelPosition = v_vTexcoord * dimension;
float tau_div = TAU / 64.;
gl_FragColor = texture2D( gm_BaseTexture, v_vTexcoord );
if(length(gl_FragColor.rgb) * gl_FragColor.a <= 0.) {
@ -22,19 +21,28 @@ void main() {
float maxCorner = 0.;
float minDistance = rad;
for(float i = rad; i >= 1.; i--)
for(float j = 0.; j < 80.; j++) {
float ang = j * tau_div;
vec2 pxs = (pixelPosition + vec2( cos(ang) * i, sin(ang) * i)) / dimension;
for(float i = rad; i >= 1.; i--) {
float base = 1.;
float top = 0.;
for(float j = 0.; j <= 64.; j++) {
float ang = top / base * TAU;
top += 2.;
if(top >= base) {
top = 1.;
base *= 2.;
}
if(pxs.x < 0. || pxs.x > 1. || pxs.y < 0. || pxs.y > 1.)
continue;
vec2 pxs = (pixelPosition + vec2( cos(ang) * i, sin(ang) * i)) / dimension;
float corn = floor(texture2D( gm_BaseTexture, pxs).r * rad);
if(pxs.x < 0. || pxs.x > 1. || pxs.y < 0. || pxs.y > 1.)
continue;
if(corn >= maxCorner) {
maxCorner = corn;
minDistance = i;
float corn = floor(texture2D( gm_BaseTexture, pxs).r * rad);
if(corn >= maxCorner) {
maxCorner = corn;
minDistance = i;
}
}
}

View file

@ -7,31 +7,39 @@ varying vec4 v_vColour;
uniform vec2 dimension;
uniform float size;
#define TAU 6.28318
#define TAU 6.283185307179586
void main() {
vec2 pixelPosition = v_vTexcoord * dimension;
float tau_div = TAU / 64.;
gl_FragColor = texture2D( gm_BaseTexture, v_vTexcoord );
if(length(gl_FragColor.rgb) * gl_FragColor.a <= 0.)
return;
for(float i = 1.; i <= size; i++)
for(float j = 0.; j < 80.; j++) {
float ang = j * tau_div;
vec2 pxs = (pixelPosition + vec2( cos(ang) * i, sin(ang) * i)) / dimension;
for(float i = 1.; i <= size; i++) {
float base = 1.;
float top = 0.;
for(float j = 0.; j <= 64.; j++) {
float ang = top / base * TAU;
top += 2.;
if(top >= base) {
top = 1.;
base *= 2.;
}
if(pxs.x < 0. || pxs.x > 1. || pxs.y < 0. || pxs.y > 1.) {
gl_FragColor = vec4(i / size, 0., 0., 1.);
return;
}
vec2 pxs = (pixelPosition + vec2( cos(ang) * i, sin(ang) * i)) / dimension;
vec4 sam = texture2D( gm_BaseTexture, pxs );
if(length(sam.rgb) == 0.) {
gl_FragColor = vec4(i / size, 0., 0., 1.);
return;
if(pxs.x < 0. || pxs.x > 1. || pxs.y < 0. || pxs.y > 1.) {
gl_FragColor = vec4(i / size, 0., 0., 1.);
return;
}
vec4 sam = texture2D( gm_BaseTexture, pxs );
if(length(sam.rgb) == 0.) {
gl_FragColor = vec4(i / size, 0., 0., 1.);
return;
}
}
}
}

View file

@ -34,7 +34,7 @@ const mat3 laplac = mat3( 1., 1., 1.,
1., -8., 1.,
1., 1., 1);
#define TAU 6.28318
#define TAU 6.283185307179586
float bright(in vec4 col) {
return dot(col.rgb, vec3(0.2126, 0.7152, 0.0722)) * col.a;

View file

@ -9,7 +9,7 @@ uniform float size;
uniform int border;
uniform int alpha;
#define TAU 6.28318
#define TAU 6.283185307179586
float bright(in vec4 col) {
return dot(col.rgb, vec3(0.2126, 0.7152, 0.0722)) * col.a;
@ -20,7 +20,6 @@ void main() {
vec4 point = texture2D( gm_BaseTexture, v_vTexcoord );
vec4 fill = vec4(0.);
if(alpha == 0) fill.a = 1.;
float tau_div = TAU / 64.;
gl_FragColor = point;
if(alpha == 0 && length(point.rgb) <= 0.)
@ -28,22 +27,31 @@ void main() {
if(alpha == 1 && point.a <= 0.)
return;
for(float i = 1.; i < size; i++)
for(float j = 0.; j < 64.; j++) {
float ang = j * tau_div;
vec2 pxs = (pixelPosition + vec2( cos(ang) * i, sin(ang) * i)) / dimension;
if(border == 1)
pxs = clamp(pxs, vec2(0.), vec2(1.));
for(float i = 1.; i < size; i++) {
float base = 1.;
float top = 0.;
for(float j = 0.; j <= 64.; j++) {
float ang = top / base * TAU;
top += 2.;
if(top >= base) {
top = 1.;
base *= 2.;
}
if(pxs.x < 0. || pxs.x > 1. || pxs.y < 0. || pxs.y > 1.) {
gl_FragColor = fill;
break;
}
vec2 pxs = (pixelPosition + vec2( cos(ang) * i, sin(ang) * i)) / dimension;
if(border == 1)
pxs = clamp(pxs, vec2(0.), vec2(1.));
vec4 sam = texture2D( gm_BaseTexture, pxs );
if((alpha == 0 && length(sam.rgb) * sam.a == 0.) || (alpha == 1 && sam.a == 0.)) {
gl_FragColor = fill;
break;
if(pxs.x < 0. || pxs.x > 1. || pxs.y < 0. || pxs.y > 1.) {
gl_FragColor = fill;
break;
}
vec4 sam = texture2D( gm_BaseTexture, pxs );
if((alpha == 0 && length(sam.rgb) * sam.a == 0.) || (alpha == 1 && sam.a == 0.)) {
gl_FragColor = fill;
break;
}
}
}
}

View file

@ -4,7 +4,7 @@
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
#define TAU 6.28318
#define TAU 6.283185307179586
uniform int gradient_blend;
uniform vec4 gradient_color[16];

View file

@ -4,7 +4,7 @@
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
#define TAU 6.28318
#define TAU 6.283185307179586
uniform int gradient_blend;
uniform vec4 gradient_color[16];

View file

@ -4,7 +4,7 @@
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
#define TAU 6.28318
#define TAU 6.283185307179586
uniform vec2 dimension;
uniform vec2 center[4];

View file

@ -1,7 +1,7 @@
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
#define TAU 6.28318
#define TAU 6.283185307179586
#define pi1 3.14159
#define pi2 1.57079

View file

@ -1,7 +1,7 @@
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
#define TAU 6.28318
#define TAU 6.283185307179586
#define pi1 3.14159
#define pi2 1.57079

View file

@ -18,7 +18,7 @@ uniform int sampleMode;
uniform int outline_only;
#define TAU 6.28318
#define TAU 6.283185307179586
vec2 round(in vec2 v) {
v.x = fract(v.x) > 0.5? ceil(v.x) : floor(v.x);
@ -67,12 +67,19 @@ void main() {
if(borderSize + borderStart > 0.) {
outline_alpha = 0.;
float tauDiv = TAU / 64.;
for(float i = 1.; i <= 32.; i++) {
if(i > borderStart + borderSize) break;
for(float j = 0.; j < 64.; j++) {
float ang = j * tauDiv;
float base = 1.;
float top = 0.;
for(float j = 0.; j <= 64.; j++) {
float ang = top / base * TAU;
top += 2.;
if(top >= base) {
top = 1.;
base *= 2.;
}
vec2 pxs = (pixelPosition + vec2( cos(ang), sin(ang)) * i) / dimension;
vec4 sam = sampleTexture( pxs );

View file

@ -8,12 +8,11 @@ uniform vec2 dimension;
uniform float borderSize;
uniform vec4 borderColor;
#define TAU 6.28318
#define TAU 6.283185307179586
void main() {
vec2 pixelPosition = v_vTexcoord * dimension;
vec4 point = v_vColour * texture2D( gm_BaseTexture, v_vTexcoord );
float tauDiv = TAU / 64.;
gl_FragColor = vec4(0.);
@ -23,8 +22,16 @@ void main() {
break;
}
for(float j = 0.; j < 64.; j++) {
float ang = j * tauDiv;
float base = 1.;
float top = 0.;
for(float j = 0.; j <= 64.; j++) {
float ang = top / base * TAU;
top += 2.;
if(top >= base) {
top = 1.;
base *= 2.;
}
vec2 pxs = (pixelPosition + vec2( cos(ang) * i, sin(ang) * i)) / dimension;
if(pxs.x < 0. || pxs.y < 0. || pxs.x > 1. || pxs.y > 1.)
continue;

View file

@ -106,31 +106,39 @@ void main() {
}
if(ao > 0.) {
float tauDiv = TAU / 32.;
float ambient = 0.;
for(float i = 0.; i < ao; i++)
for(float j = 0.; j < 32.; j++) {
float ang = j * tauDiv;
vec2 _pos = v_vTexcoord + vec2(cos(ang), sin(ang)) * i * tx;
for(float i = 0.; i < ao; i++) {
float base = 1.;
float top = 0.;
for(float j = 0.; j <= 64.; j++) {
float ang = top / base * TAU;
top += 2.;
if(top >= base) {
top = 1.;
base *= 2.;
}
if(_pos.x < 0. || _pos.y < 0. || _pos.x > 1. || _pos.y > 1.)
continue;
vec2 _pos = v_vTexcoord + vec2(cos(ang), sin(ang)) * i * tx;
if(useSolid == 1) {
vec4 _sl = texture2D( solid, _pos );
if(_sl.a == 1.)
ambient++;
}
if(_pos.x < 0. || _pos.y < 0. || _pos.x > 1. || _pos.y > 1.)
continue;
if(bgUse == 1) {
vec4 hg = texture2D( gm_BaseTexture, _pos );
if(distance(bg, hg) >= bgThres)
ambient++;
if(useSolid == 1) {
vec4 _sl = texture2D( solid, _pos );
if(_sl.a == 1.)
ambient++;
}
if(bgUse == 1) {
vec4 hg = texture2D( gm_BaseTexture, _pos );
if(distance(bg, hg) >= bgThres)
ambient++;
}
}
}
lightAmo += ambient * aoStr;
lightAmo += ambient * aoStr * aoStr;
}
int lightCatched = 0;

View file

@ -27,7 +27,7 @@ uniform vec2 scale;
uniform vec4 bgColor;
#define PI 3.14159265359
#define TAU 6.28318530718
#define TAU 6.283185307179586
float sdRegularPolygon(in vec2 p, in float r, in int n, in float ang ) {
// these 4 lines can be precomputed for a given shape

View file

@ -6,7 +6,7 @@ varying vec4 v_vColour;
uniform vec2 dimension;
uniform float size;
#define TAU 6.28318
#define TAU 6.283185307179586
void main() {
vec2 pixelPosition = v_vTexcoord * dimension;

View file

@ -13,6 +13,8 @@ uniform float segmentStart;
uniform float segmentSize;
uniform int mode;
uniform int matchColor;
uniform int blendColor;
void main() {
gl_FragColor = vec4(0.);
@ -44,22 +46,28 @@ void main() {
if(col0.a <= 0.5) continue;
vec2 norm = normalize(shift) * texel;
vec4 _colS = vec4(0.);
int searchStage = 0;
for(float k = 0.; k <= range; k++) {
vec2 posS = v_vTexcoord - norm * k;
if(searchStage == 0 && (posS.x < 0. || posS.y < 0. || posS.x > 1. || posS.y > 1.)) continue;
vec4 colS = texture2D( prevFrame, posS );
if(mode == 0) {
if(distance(colS, col0) > 0.1) continue;
gl_FragColor = colS;
if(mode == 0 && matchColor == 1) {
if(matchColor == 1 && distance(colS, col0) > 0.1) continue;
gl_FragColor = col0;
return;
} else {
if(searchStage == 0 && distance(colS, col0) < 0.1) {
if(searchStage == 0 && ((matchColor == 0 && colS.a > 0.5) || (matchColor == 1 && distance(colS, col0) < 0.1))) {
searchStage = 1;
continue;
} else if(searchStage == 1 && distance(colS, col0) > 0.1) {
gl_FragColor = vec4(norm.x, norm.y, segmentStart + segmentSize * (1. - k / (k + i)), 1.);
_colS = colS;
gl_FragColor = col0;
} else if(searchStage == 1 && ((matchColor == 0 && colS.a < 0.5) || (matchColor == 1 && distance(colS, col0) > 0.1))) {
if(matchColor == 0)
gl_FragColor = mix(_colS, col0, blendColor == 0? 1. : k / (k + i));
else
gl_FragColor = vec4(norm.x, norm.y, segmentStart + segmentSize * (1. - k / (k + i)), 1.);
return;
}
}