mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2025-01-23 11:28:06 +01:00
1.0.1 update
This commit is contained in:
parent
04e17c30f5
commit
5d5e9f8f99
97 changed files with 1397 additions and 1599 deletions
|
@ -18,6 +18,7 @@
|
|||
{"id":{"name":"node_3d_obj","path":"scripts/node_3d_obj/node_3d_obj.yy",},"order":8,},
|
||||
{"id":{"name":"o_dialog_menubox","path":"objects/o_dialog_menubox/o_dialog_menubox.yy",},"order":1,},
|
||||
{"id":{"name":"s_node_blend","path":"sprites/s_node_blend/s_node_blend.yy",},"order":5,},
|
||||
{"id":{"name":"draw_text_function","path":"scripts/draw_text_function/draw_text_function.yy",},"order":11,},
|
||||
{"id":{"name":"libdlgmodule","path":"extensions/libdlgmodule/libdlgmodule.yy",},"order":2,},
|
||||
{"id":{"name":"node_line","path":"scripts/node_line/node_line.yy",},"order":7,},
|
||||
{"id":{"name":"s_node_frame","path":"sprites/s_node_frame/s_node_frame.yy",},"order":1,},
|
||||
|
@ -418,6 +419,7 @@
|
|||
{"id":{"name":"node_wrap_mesh","path":"scripts/node_wrap_mesh/node_wrap_mesh.yy",},"order":7,},
|
||||
{"id":{"name":"sh_blur_alpha","path":"shaders/sh_blur_alpha/sh_blur_alpha.yy",},"order":2,},
|
||||
{"id":{"name":"node_sprite_sheet","path":"scripts/node_sprite_sheet/node_sprite_sheet.yy",},"order":0,},
|
||||
{"id":{"name":"value_snap","path":"scripts/value_snap/value_snap.yy",},"order":10,},
|
||||
{"id":{"name":"compat_path_array","path":"scripts/compat_path_array/compat_path_array.yy",},"order":0,},
|
||||
{"id":{"name":"node_export","path":"scripts/node_export/node_export.yy",},"order":1,},
|
||||
{"id":{"name":"controlPointBox","path":"scripts/controlPointBox/controlPointBox.yy",},"order":21,},
|
||||
|
@ -551,7 +553,7 @@
|
|||
{"id":{"name":"node_bw","path":"scripts/node_bw/node_bw.yy",},"order":20,},
|
||||
{"id":{"name":"sh_de_corner","path":"shaders/sh_de_corner/sh_de_corner.yy",},"order":14,},
|
||||
{"id":{"name":"file_dropper","path":"extensions/file_dropper/file_dropper.yy",},"order":7,},
|
||||
{"id":{"name":"sprite_loader","path":"scripts/sprite_loader/sprite_loader.yy",},"order":12,},
|
||||
{"id":{"name":"sprite_loader","path":"scripts/sprite_loader/sprite_loader.yy",},"order":10,},
|
||||
{"id":{"name":"s_node_iterator_index","path":"sprites/s_node_iterator_index/s_node_iterator_index.yy",},"order":8,},
|
||||
{"id":{"name":"node_de_corner","path":"scripts/node_de_corner/node_de_corner.yy",},"order":25,},
|
||||
{"id":{"name":"preferences","path":"scripts/preferences/preferences.yy",},"order":4,},
|
||||
|
@ -888,7 +890,6 @@
|
|||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_frame_bg.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_prop_gradient_strip2.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/inspector",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_inspector_text_valign_strip3.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/inspector",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"graphics.ai","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/preview",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"anchor_selector_strip3.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/preview",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_inspector_text_halign_strip3.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/inspector",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_filter_24.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
|
||||
|
@ -947,9 +948,11 @@
|
|||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"graphic x2.ai","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",},
|
||||
{"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_vfx.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"default.zip","CopyToMask":-1,"filePath":"datafiles/data/themes",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Assets.zip","CopyToMask":-1,"filePath":"datafiles/data",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Collections.zip","CopyToMask":-1,"filePath":"datafiles/data",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"graphics.ai","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/preview",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"anchor_arrow.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/preview",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"default.zip","CopyToMask":-1,"filePath":"datafiles/data/themes",},
|
||||
],
|
||||
"MetaData": {
|
||||
"IDEVersion": "2022.11.1.56",
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
|
@ -69,6 +69,7 @@
|
|||
"node_wiggler_frame": "blue_grey",
|
||||
"node_border_file_drop": "cyan",
|
||||
|
||||
"scrollbar_bg": "blue_dkblack",
|
||||
"scrollbar_hover": "blue_white",
|
||||
"scrollbar_idle": "blue_grey",
|
||||
|
||||
|
|
|
@ -912,6 +912,13 @@
|
|||
"yorigin": 18,
|
||||
"slice": null
|
||||
},
|
||||
"anchor_arrow": {
|
||||
"path": "./preview/anchor_arrow.png",
|
||||
"subimages": 2,
|
||||
"xorigin": 18,
|
||||
"yorigin": 18,
|
||||
"slice": null
|
||||
},
|
||||
"preview_crosshair": {
|
||||
"path": "./preview/s_preview_crosshair.png",
|
||||
"subimages": 1,
|
||||
|
|
BIN
datafiles/data/themes/default/graphics/preview/anchor_arrow.png
Normal file
BIN
datafiles/data/themes/default/graphics/preview/anchor_arrow.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
File diff suppressed because one or more lines are too long
|
@ -123,7 +123,7 @@ event_inherited();
|
|||
|
||||
if(i == ADD_NODE_PAGE) {
|
||||
draw_sprite_stretched(THEME.ui_panel_bg, 0, 0, _y + hh, ui(132), hg);
|
||||
} else if(sHOVER && point_in_rectangle(_m[0], _m[1], 0, _y + hh, ui(100), _y + hh + hg - 1)) {
|
||||
} else if(sHOVER && catagory_pane.hover && point_in_rectangle(_m[0], _m[1], 0, _y + hh, ui(100), _y + hh + hg - 1)) {
|
||||
draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, 0, _y + hh, ui(132), hg, c_white, 0.75);
|
||||
if(mouse_click(mb_left, sFOCUS)) {
|
||||
setPage(i);
|
||||
|
@ -144,6 +144,7 @@ event_inherited();
|
|||
|
||||
var node_count = ds_list_size(node_list);
|
||||
var hh = 0;
|
||||
var _hover = sHOVER && content_pane.hover;
|
||||
|
||||
if(ADD_NODE_MODE == 0) {
|
||||
var grid_size = ui(64);
|
||||
|
@ -170,7 +171,7 @@ event_inherited();
|
|||
draw_sprite_stretched(THEME.node_bg, 0, _boxx, yy, grid_size, grid_size);
|
||||
BLEND_NORMAL
|
||||
|
||||
if(sHOVER && point_in_rectangle(_m[0], _m[1], _nx, yy, _nx + grid_width, yy + grid_size)) {
|
||||
if(_hover && point_in_rectangle(_m[0], _m[1], _nx, yy, _nx + grid_width, yy + grid_size)) {
|
||||
draw_sprite_stretched_ext(THEME.node_active, 0, _boxx, yy, grid_size, grid_size, COLORS._main_accent, 1);
|
||||
if(mouse_press(mb_left, sFOCUS))
|
||||
buildNode(_node);
|
||||
|
@ -183,7 +184,7 @@ event_inherited();
|
|||
|
||||
draw_set_text(f_p2, fa_center, fa_top, COLORS._main_text);
|
||||
name_height = max(name_height, string_height_ext(_node.name, -1, grid_width) + 8);
|
||||
draw_text_ext(_boxx + grid_size / 2, yy + grid_size + 4, _node.name, -1, grid_width);
|
||||
draw_text_ext_add(_boxx + grid_size / 2, yy + grid_size + 4, _node.name, -1, grid_width);
|
||||
}
|
||||
}
|
||||
var hght = grid_size + grid_space + name_height;
|
||||
|
@ -206,7 +207,7 @@ event_inherited();
|
|||
BLEND_NORMAL
|
||||
}
|
||||
|
||||
if(sHOVER && point_in_rectangle(_m[0], _m[1], 0, yy, list_width, yy + list_height - 1)) {
|
||||
if(_hover && point_in_rectangle(_m[0], _m[1], 0, yy, list_width, yy + list_height - 1)) {
|
||||
draw_sprite_stretched_ext(THEME.node_active, 0, ui(4), yy, list_width - ui(8), list_height, COLORS._main_accent, 1);
|
||||
if(mouse_press(mb_left, sFOCUS))
|
||||
buildNode(_node);
|
||||
|
@ -220,7 +221,7 @@ event_inherited();
|
|||
}
|
||||
|
||||
draw_set_text(f_p2, fa_left, fa_center, COLORS._main_text);
|
||||
draw_text(list_height + ui(20), yy + list_height / 2, _node.name);
|
||||
draw_text_add(list_height + ui(20), yy + list_height / 2, _node.name);
|
||||
|
||||
yy += list_height;
|
||||
hh += list_height;
|
||||
|
@ -302,6 +303,7 @@ event_inherited();
|
|||
|
||||
var amo = ds_list_size(search_list);
|
||||
var hh = 0;
|
||||
var _hover = sHOVER && search_pane.hover;
|
||||
|
||||
if(ADD_NODE_MODE == 0) {
|
||||
var grid_size = ui(64);
|
||||
|
@ -353,9 +355,9 @@ event_inherited();
|
|||
draw_set_text(f_p2, fa_center, fa_top, COLORS._main_text);
|
||||
var txt = _node.name;
|
||||
name_height = max(name_height, string_height_ext(txt, -1, grid_width) + ui(8));
|
||||
draw_text_ext(_boxx + grid_size / 2, yy + grid_size + 4, txt, -1, grid_width);
|
||||
draw_text_ext_add(_boxx + grid_size / 2, yy + grid_size + 4, txt, -1, grid_width);
|
||||
|
||||
if(sHOVER && point_in_rectangle(_m[0], _m[1], _nx, yy, _nx + grid_width, yy + grid_size)) {
|
||||
if(_hover && point_in_rectangle(_m[0], _m[1], _nx, yy, _nx + grid_width, yy + grid_size)) {
|
||||
node_selecting = i;
|
||||
if(mouse_press(mb_left, sFOCUS))
|
||||
buildNode(_node, _param);
|
||||
|
@ -417,9 +419,9 @@ event_inherited();
|
|||
}
|
||||
|
||||
draw_set_text(f_p2, fa_left, fa_center, COLORS._main_text);
|
||||
draw_text(list_height + ui(20), yy + list_height / 2, _node.name);
|
||||
draw_text_add(list_height + ui(20), yy + list_height / 2, _node.name);
|
||||
|
||||
if(sHOVER && point_in_rectangle(_m[0], _m[1], 0, yy, list_width, yy + list_height - 1)) {
|
||||
if(_hover && point_in_rectangle(_m[0], _m[1], 0, yy, list_width, yy + list_height - 1)) {
|
||||
node_selecting = i;
|
||||
if(mouse_press(mb_left, sFOCUS))
|
||||
buildNode(_node, _param);
|
||||
|
|
|
@ -79,7 +79,7 @@ event_inherited();
|
|||
draw_sprite_stretched(THEME.node_bg, 0, xx, yy, grid_size, grid_size);
|
||||
BLEND_NORMAL
|
||||
|
||||
if(sHOVER && point_in_rectangle(_m[0], _m[1], xx, yy, xx + grid_size, yy + grid_size)) {
|
||||
if(sHOVER && contentPane.hover && point_in_rectangle(_m[0], _m[1], xx, yy, xx + grid_size, yy + grid_size)) {
|
||||
draw_sprite_stretched_ext(THEME.node_active, 0, xx, yy, grid_size, grid_size, COLORS._main_accent, 1);
|
||||
if(mouse_press(mb_left, sFOCUS)) {
|
||||
target.onModify(content.path);
|
||||
|
@ -111,7 +111,8 @@ event_inherited();
|
|||
var hh = 8;
|
||||
|
||||
for(var i = 0; i < ds_list_size(global.ASSETS.subDir); i++) {
|
||||
var hg = global.ASSETS.subDir[| i].draw(self, ui(8), _y + 8, _m, folderPane.w - ui(16), sHOVER, sFOCUS, global.ASSETS);
|
||||
var hg = global.ASSETS.subDir[| i].draw(self, ui(8), _y + 8, _m, folderPane.w - ui(16),
|
||||
sHOVER && folderPane.hover, sFOCUS, global.ASSETS);
|
||||
hh += hg;
|
||||
_y += hg;
|
||||
}
|
||||
|
|
|
@ -41,6 +41,7 @@ event_inherited();
|
|||
var _gs = sp_preset_size;
|
||||
var yy = _y + ui(8);
|
||||
var _height, pre_amo;
|
||||
var _hover = sHOVER && sp_presets.hover;
|
||||
draw_clear_alpha(COLORS.panel_bg_clear, 0);
|
||||
|
||||
for(var i = 0; i < ds_list_size(presets); i++) {
|
||||
|
@ -53,7 +54,7 @@ event_inherited();
|
|||
else
|
||||
_height = ui(56);
|
||||
|
||||
var isHover = sHOVER && point_in_rectangle(_m[0], _m[1], ui(4), yy, ui(4) + sp_preset_w - ui(16), yy + _height);
|
||||
var isHover = _hover && point_in_rectangle(_m[0], _m[1], ui(4), yy, ui(4) + sp_preset_w - ui(16), yy + _height);
|
||||
|
||||
draw_sprite_stretched(THEME.ui_panel_bg, 1, ui(4), yy, sp_preset_w - ui(16), _height);
|
||||
if(isHover)
|
||||
|
@ -67,7 +68,7 @@ event_inherited();
|
|||
drawPalette(presets[| i], ui(16), yy + ui(28), ww, ui(20));
|
||||
|
||||
if(!click_block && mouse_click(mb_left, sFOCUS)) {
|
||||
if(preset_selecting == i && sHOVER && point_in_rectangle(_m[0], _m[1], ui(16), yy + ui(28), ui(16) + ww, yy + ui(28) + _height)) {
|
||||
if(preset_selecting == i && _hover && point_in_rectangle(_m[0], _m[1], ui(16), yy + ui(28), ui(16) + ww, yy + ui(28) + _height)) {
|
||||
var m_ax = _m[0] - ui(16);
|
||||
var m_ay = _m[1] - (yy + ui(28));
|
||||
|
||||
|
|
|
@ -106,28 +106,27 @@ event_inherited();
|
|||
var hh = ui(32);
|
||||
var yy = _y + ui(8);
|
||||
var hg = ui(52);
|
||||
var _hover = sHOVER && sp_presets.hover;
|
||||
draw_clear_alpha(COLORS.panel_bg_clear, 0);
|
||||
|
||||
for(var i = 0; i < ds_list_size(presets); i++) {
|
||||
var isHover = point_in_rectangle(_m[0], _m[1], ui(4), yy, ui(4) + sp_preset_w - ui(16), yy + hg);
|
||||
|
||||
draw_sprite_stretched(THEME.ui_panel_bg, 1, ui(4), yy, sp_preset_w - ui(16), hg);
|
||||
if(sHOVER && isHover)
|
||||
if(_hover && isHover)
|
||||
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_gradient(ui(16), yy + ui(28), ww, ui(16), presets[| i]);
|
||||
|
||||
if(sFOCUS && isHover) {
|
||||
if(mouse_press(mb_left, sFOCUS)) {
|
||||
if(_hover && isHover && mouse_press(mb_left, sFOCUS)) {
|
||||
var target = presets[| i];
|
||||
ds_list_clear(gradient);
|
||||
for( var i = 0; i < ds_list_size(target); i++ ) {
|
||||
ds_list_add(gradient, new valueKey(target[| i].time, target[| i].value));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
yy += hg + ui(4);
|
||||
hh += hg + ui(4);
|
||||
|
|
|
@ -18,7 +18,7 @@ if !ready exit;
|
|||
cb_enable.hover = sHOVER;
|
||||
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text);
|
||||
draw_text(dialog_x + ui(32), yy, "Snap to grid");
|
||||
cb_enable.draw(dialog_x + dialog_w - ww / 2, yy, PANEL_GRAPH.node_drag_snap, mouse_ui,, fa_center, fa_center);
|
||||
cb_enable.draw(dialog_x + dialog_w - ui(24) - ww / 2, yy, PANEL_GRAPH.node_drag_snap, mouse_ui,, fa_center, fa_center);
|
||||
|
||||
yy += ui(40);
|
||||
tb_size.active = sFOCUS;
|
||||
|
|
|
@ -57,7 +57,7 @@ event_inherited();
|
|||
|
||||
draw_sprite_stretched(THEME.ui_panel_bg, 0, xx, yy, ww, hh);
|
||||
|
||||
if(sHOVER && point_in_rectangle(_m[0], _m[1], xx, yy, xx + ww, yy + hh)) {
|
||||
if(sHOVER && sp_content.hover && point_in_rectangle(_m[0], _m[1], xx, yy, xx + ww, yy + hh)) {
|
||||
inb_hover = index;
|
||||
if(dragging == -1)
|
||||
draw_sprite_stretched_ext(THEME.ui_panel_active, 0, xx, yy, ww, hh, COLORS._main_accent, 1);
|
||||
|
|
|
@ -24,7 +24,7 @@ event_inherited();
|
|||
var amo = ds_list_size(STATUSES);
|
||||
|
||||
draw_set_font(f_p3);
|
||||
var timeW = string_width("00:00");
|
||||
var timeW = string_width("00:00:00");
|
||||
|
||||
for( var i = 0; i < ds_list_size(STATUSES); i++ ) {
|
||||
var index = amo - 1 - i;
|
||||
|
@ -38,7 +38,7 @@ event_inherited();
|
|||
var cc = COLORS.dialog_notification_bg;
|
||||
draw_sprite_stretched_ext(THEME.group_label, 0, 0, yy + ui(2), _w, _h - ui(4), COLORS.dialog_notification_bg, 1);
|
||||
|
||||
if(sHOVER && point_in_rectangle(_m[0], _m[1], 0, yy, _w, yy + _h - ui(4))) {
|
||||
if(sHOVER && sp_noti.hover && point_in_rectangle(_m[0], _m[1], 0, yy, _w, yy + _h - ui(4))) {
|
||||
cc = COLORS.dialog_notification_bg_hover;
|
||||
|
||||
if(noti.onClick != noone && mouse_press(mb_left, sFOCUS))
|
||||
|
|
|
@ -56,7 +56,7 @@ event_inherited();
|
|||
draw_clear_alpha(COLORS.panel_bg_clear, 0);
|
||||
|
||||
for(var i = 0; i < ds_list_size(presets); i++) {
|
||||
var isHover = sHOVER && point_in_rectangle(_m[0], _m[1], ui(4), yy, ui(4) + sp_preset_w - ui(16), yy + hg);
|
||||
var isHover = sHOVER && sp_presets.hover && point_in_rectangle(_m[0], _m[1], ui(4), yy, ui(4) + sp_preset_w - ui(16), yy + hg);
|
||||
draw_sprite_stretched(THEME.ui_panel_bg, 1, ui(4), yy, sp_preset_w - ui(16), hg);
|
||||
if(isHover)
|
||||
draw_sprite_stretched_ext(THEME.node_active, 1, ui(4), yy, sp_preset_w - ui(16), hg, COLORS._main_accent, 1);
|
||||
|
|
|
@ -278,7 +278,7 @@ event_inherited();
|
|||
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text);
|
||||
draw_text(ui(8), yy + th / 2, keyStr);
|
||||
|
||||
var b = buttonInstant(THEME.button, cx, yy + ui(2), cw, ch, _m, sFOCUS, sHOVER);
|
||||
var b = buttonInstant(THEME.button, cx, yy + ui(2), cw, ch, _m, sFOCUS, sHOVER && sp_colors.hover);
|
||||
draw_sprite_stretched_ext(THEME.color_picker_sample, 0, cx + ui(2), yy + ui(2 + 2), cw - ui(4), ch - ui(4), val, 1);
|
||||
|
||||
if(b == 2) {
|
||||
|
@ -343,7 +343,7 @@ event_inherited();
|
|||
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text);
|
||||
draw_text(ui(8), yy + th / 2, _pref[0]);
|
||||
_pref[2].active = sFOCUS;
|
||||
_pref[2].hover = sHOVER;
|
||||
_pref[2].hover = sHOVER && sp_pref.hover;
|
||||
|
||||
switch(instanceof(_pref[2])) {
|
||||
case "textBox" :
|
||||
|
@ -468,7 +468,8 @@ event_inherited();
|
|||
|
||||
draw_sprite_stretched(THEME.button_hide, 2, x1 - ui(40) - kw, _y + hh - ui(6), kw + ui(32), th + ui(12));
|
||||
} else {
|
||||
if(buttonInstant(THEME.button_hide, x1 - ui(40) - kw, _y + hh - ui(6), kw + ui(32), th + ui(12), _m, sFOCUS, sHOVER) == 2) {
|
||||
if(buttonInstant(THEME.button_hide, x1 - ui(40) - kw, _y + hh - ui(6), kw + ui(32), th + ui(12),
|
||||
_m, sFOCUS, sHOVER && sp_hotkey.hover) == 2) {
|
||||
hk_editing = key;
|
||||
keyboard_lastchar = pkey;
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ event_inherited();
|
|||
var preset = pres[i];
|
||||
var _yy = _y + hh * i;
|
||||
|
||||
if(sHOVER && point_in_rectangle(_m[0], _m[1], 0, _yy, sc_presets.w, _yy + hh)) {
|
||||
if(sHOVER && sc_presets.hover && point_in_rectangle(_m[0], _m[1], 0, _yy, sc_presets.w, _yy + hh)) {
|
||||
draw_sprite_stretched(THEME.node_bg, 0, 0, _yy, sc_presets.w - ui(12), hh);
|
||||
if(mouse_click(mb_left, sFOCUS)) {
|
||||
node.deserialize(preset.content, true, true);
|
||||
|
|
|
@ -3,16 +3,20 @@ event_inherited();
|
|||
|
||||
#region data
|
||||
dialog_w = ui(320);
|
||||
dialog_h = ui(260);
|
||||
dialog_h = ui(300);
|
||||
|
||||
destroy_on_click_out = true;
|
||||
#endregion
|
||||
|
||||
#region data
|
||||
cb_enable = new checkBox(function(str) {
|
||||
cb_enable = new checkBox(function() {
|
||||
PANEL_PREVIEW.grid_show = !PANEL_PREVIEW.grid_show;
|
||||
});
|
||||
|
||||
cb_snap = new checkBox(function() {
|
||||
PANEL_PREVIEW.grid_snap = !PANEL_PREVIEW.grid_snap;
|
||||
});
|
||||
|
||||
tb_width = new textBox(TEXTBOX_INPUT.number, function(str) {
|
||||
PANEL_PREVIEW.grid_width = max(1, real(str));
|
||||
});
|
||||
|
|
|
@ -18,7 +18,14 @@ if !ready exit;
|
|||
cb_enable.hover = sHOVER;
|
||||
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text);
|
||||
draw_text(dialog_x + ui(32), yy, "Enabled");
|
||||
cb_enable.draw(dialog_x + dialog_w - ww / 2, yy, PANEL_PREVIEW.grid_show, mouse_ui,, fa_center, fa_center);
|
||||
cb_enable.draw(dialog_x + dialog_w - ui(24) - ww / 2, yy, PANEL_PREVIEW.grid_show, mouse_ui,, fa_center, fa_center);
|
||||
|
||||
yy += ui(40);
|
||||
cb_snap.active = sFOCUS;
|
||||
cb_snap.hover = sHOVER;
|
||||
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text);
|
||||
draw_text(dialog_x + ui(32), yy, "Snap to grid");
|
||||
cb_snap.draw(dialog_x + dialog_w - ui(24) - ww / 2, yy, PANEL_PREVIEW.grid_snap, mouse_ui,, fa_center, fa_center);
|
||||
|
||||
yy += ui(40);
|
||||
tb_width.active = sFOCUS;
|
||||
|
|
|
@ -21,7 +21,7 @@ event_inherited();
|
|||
for(var i = 0; i < array_length(data); i++) {
|
||||
var _ly = _y + i * hght;
|
||||
|
||||
if(sHOVER && point_in_rectangle(_m[0], _m[1], 0, _ly + 1, _dw, _ly + hght - 1)) {
|
||||
if(sHOVER && sc_content.hover && point_in_rectangle(_m[0], _m[1], 0, _ly + 1, _dw, _ly + hght - 1)) {
|
||||
draw_sprite_stretched_ext(THEME.textbox, 3, 0, _ly, _dw, hght, COLORS.dialog_menubox_highlight, 1);
|
||||
|
||||
if(mouse_press(mb_left, sFOCUS)) {
|
||||
|
|
|
@ -27,7 +27,7 @@ event_inherited();
|
|||
if(!file_exists(_rec)) continue;
|
||||
draw_sprite_stretched(THEME.ui_panel_bg, 1, 0, _y, ww, hg);
|
||||
|
||||
if(sHOVER && point_in_rectangle(_m[0], _m[1], 0, _y, ww, _y + hg)) {
|
||||
if(sHOVER && sp_recent.hover && point_in_rectangle(_m[0], _m[1], 0, _y, ww, _y + hg)) {
|
||||
draw_sprite_stretched_ext(THEME.node_active, 0, 0, _y, ww, hg, COLORS._main_accent, 1);
|
||||
|
||||
if(mouse_press(mb_left, sFOCUS)) {
|
||||
|
@ -77,7 +77,7 @@ event_inherited();
|
|||
var _boxx = _nx;
|
||||
|
||||
draw_sprite_stretched(THEME.node_bg, 0, _boxx, yy, grid_width, grid_heigh);
|
||||
if(sHOVER && point_in_rectangle(_m[0], _m[1], _nx, yy, _nx + grid_width, yy + grid_heigh)) {
|
||||
if(sHOVER && sp_sample.hover && point_in_rectangle(_m[0], _m[1], _nx, yy, _nx + grid_width, yy + grid_heigh)) {
|
||||
draw_sprite_stretched_ext(THEME.node_active, 0, _boxx, yy, grid_width, grid_heigh, COLORS._main_accent, 1);
|
||||
if(mouse_press(mb_left, sFOCUS)) {
|
||||
LOAD_PATH(_node.path, true);
|
||||
|
@ -109,7 +109,7 @@ event_inherited();
|
|||
|
||||
draw_set_text(f_p1, fa_center, fa_top, COLORS._main_text);
|
||||
name_height = max(name_height, string_height_ext(_node.name, -1, grid_width) + ui(8));
|
||||
draw_text_ext(tx, ty + line_height() - ui(2), _node.name, -1, grid_width);
|
||||
draw_text_ext_add(tx, ty + line_height() - ui(2), _node.name, -1, grid_width);
|
||||
}
|
||||
}
|
||||
var hght = grid_heigh + grid_space + name_height + ui(20);
|
||||
|
|
|
@ -14,15 +14,12 @@
|
|||
if(fr <= ANIMATOR.real_frame + 1)
|
||||
ANIMATOR.real_frame = fr;
|
||||
if(round(ANIMATOR.real_frame) >= ANIMATOR.frames_total) {
|
||||
switch(ANIMATOR.playback) {
|
||||
case ANIMATOR_END.loop :
|
||||
ANIMATOR.setFrame(0);
|
||||
break;
|
||||
case ANIMATOR_END.stop :
|
||||
if(ANIMATOR.playback == ANIMATOR_END.stop || ANIMATOR.stopOnEnd) {
|
||||
ANIMATOR.setFrame(ANIMATOR.frames_total - 1);
|
||||
ANIMATOR.is_playing = false;
|
||||
break;
|
||||
}
|
||||
ANIMATOR.stopOnEnd = false;
|
||||
} else
|
||||
ANIMATOR.setFrame(0);
|
||||
}
|
||||
} else {
|
||||
ANIMATOR.setFrame(ANIMATOR.real_frame);
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
"resourceType": "GMWindowsOptions",
|
||||
"resourceVersion": "1.1",
|
||||
"name": "Windows",
|
||||
"option_windows_display_name": "Pixel Composer 1.0.0",
|
||||
"option_windows_executable_name": "${project_name} 1.0.0.exe",
|
||||
"option_windows_version": "1.0.0.0",
|
||||
"option_windows_display_name": "Pixel Composer 1.0.1",
|
||||
"option_windows_executable_name": "${project_name} 1.0.1.exe",
|
||||
"option_windows_version": "1.0.1.0",
|
||||
"option_windows_company_info": "MakhamDev",
|
||||
"option_windows_product_info": "Pixel Composer",
|
||||
"option_windows_copyright_info": "",
|
||||
|
|
|
@ -322,8 +322,8 @@ function Node_VFX(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
}
|
||||
}
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
inputs[| 4].drawOverlay(active, _x, _y, _s, _mx, _my);
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
inputs[| 4].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
if(onDrawOverlay != -1)
|
||||
onDrawOverlay(active, _x, _y, _s, _mx, _my);
|
||||
}
|
||||
|
|
|
@ -55,8 +55,8 @@ function Node_Particle_Effector(_x, _y, _group = -1) : Node(_x, _y, _group) cons
|
|||
|
||||
current_data = [];
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my);
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
|
||||
var parts = inputs[| 0].getValue();
|
||||
if(!parts) return;
|
||||
|
|
|
@ -303,8 +303,8 @@ function Node_VFX_Spawner_Base(_x, _y, _group = -1) : Node(_x, _y, _group) const
|
|||
runVFX(ANIMATOR.current_frame);
|
||||
}
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
inputs[| 3].drawOverlay(active, _x, _y, _s, _mx, _my);
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
inputs[| 3].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
if(onDrawOverlay != -1)
|
||||
onDrawOverlay(active, _x, _y, _s, _mx, _my);
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
is_playing = false;
|
||||
frame_progress = false;
|
||||
|
||||
stopOnEnd = false;
|
||||
playback = ANIMATOR_END.loop;
|
||||
|
||||
static setFrame = function(frame) {
|
||||
|
@ -22,6 +23,11 @@
|
|||
#endregion
|
||||
|
||||
#region object
|
||||
enum ANIMATOR_END {
|
||||
loop,
|
||||
stop
|
||||
}
|
||||
|
||||
globalvar ANIMATOR;
|
||||
ANIMATOR = new AnimationManager();
|
||||
#endregion
|
|
@ -5,27 +5,27 @@ function checkBox(_onClick) constructor {
|
|||
onClick = _onClick;
|
||||
|
||||
static draw = function(_x, _y, _value, _m, ss = ui(28), halign = fa_left, valign = fa_top) {
|
||||
var _dx, _dy;
|
||||
switch(halign) {
|
||||
case fa_left: _x = _x; break;
|
||||
case fa_center: _x = _x - ss / 2; break;
|
||||
case fa_right: _x = _x - ss; break;
|
||||
case fa_left: _dx = _x; break;
|
||||
case fa_center: _dx = _x - ss / 2; break;
|
||||
case fa_right: _dx = _x - ss; break;
|
||||
}
|
||||
|
||||
switch(valign) {
|
||||
case fa_top: _y = _y; break;
|
||||
case fa_center: _y = _y - ss / 2; break;
|
||||
case fa_bottom: _y = _y - ss; break;
|
||||
case fa_top: _dy = _y; break;
|
||||
case fa_center: _dy = _y - ss / 2; break;
|
||||
case fa_bottom: _dy = _y - ss; break;
|
||||
}
|
||||
|
||||
draw_sprite_stretched(THEME.checkbox, _value * 2, _x, _y, ss, ss);
|
||||
draw_sprite_stretched(THEME.checkbox, _value * 2, _dx, _dy, ss, ss);
|
||||
|
||||
if(hover && point_in_rectangle(_m[0], _m[1], _x, _y, _x + ss, _y + ss)) {
|
||||
draw_sprite_stretched(THEME.checkbox, _value * 2 + 1, _x, _y, ss, ss);
|
||||
if(hover && point_in_rectangle(_m[0], _m[1], _dx, _dy, _dx + ss, _dy + ss)) {
|
||||
draw_sprite_stretched(THEME.checkbox, _value * 2 + 1, _dx, _dy, ss, ss);
|
||||
|
||||
if(mouse_press(mb_left, active)) {
|
||||
if(mouse_press(mb_left, active))
|
||||
if(onClick) onClick();
|
||||
}
|
||||
}
|
||||
|
||||
hover = false;
|
||||
active = false;
|
||||
|
|
|
@ -18,6 +18,6 @@ function draw_sprite_ui(spr, ind, _x, _y, xscale = 1, yscale = 1, rot = 0, color
|
|||
draw_sprite_ext(spr, ind, _x, _y, xscale_ui, yscale_ui, rot, color, alpha);
|
||||
}
|
||||
|
||||
function draw_sprite_ui_uniform(spr, ind, _x, _y, scale = 1, color = c_white, alpha = 1) {
|
||||
draw_sprite_ui(spr, ind, _x, _y, scale, scale, 0, color, alpha);
|
||||
function draw_sprite_ui_uniform(spr, ind, _x, _y, scale = 1, color = c_white, alpha = 1, rot = 0) {
|
||||
draw_sprite_ui(spr, ind, _x, _y, scale, scale, rot, color, alpha);
|
||||
}
|
||||
|
|
11
scripts/draw_text_function/draw_text_function.gml
Normal file
11
scripts/draw_text_function/draw_text_function.gml
Normal file
|
@ -0,0 +1,11 @@
|
|||
function draw_text_add(_x, _y, _text){
|
||||
BLEND_ADD
|
||||
draw_text(_x, _y, _text);
|
||||
BLEND_NORMAL
|
||||
}
|
||||
|
||||
function draw_text_ext_add(_x, _y, _text, _sep, _w){
|
||||
BLEND_ADD
|
||||
draw_text_ext(_x, _y, _text, _sep, _w);
|
||||
BLEND_NORMAL
|
||||
}
|
11
scripts/draw_text_function/draw_text_function.yy
Normal file
11
scripts/draw_text_function/draw_text_function.yy
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"resourceType": "GMScript",
|
||||
"resourceVersion": "1.0",
|
||||
"name": "draw_text_function",
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "draw",
|
||||
"path": "folders/functions/draw.yy",
|
||||
},
|
||||
}
|
|
@ -20,9 +20,9 @@
|
|||
COLOR_KEYS = [];
|
||||
|
||||
globalvar VERSION, SAVEFILE_VERSION, VERSION_STRING;
|
||||
VERSION = 1000;
|
||||
VERSION = 1010;
|
||||
SAVEFILE_VERSION = 1000;
|
||||
VERSION_STRING = "1.0.0";
|
||||
VERSION_STRING = "1.0.1";
|
||||
|
||||
globalvar NODES, NODE_MAP, APPEND_MAP, HOTKEYS, HOTKEY_CONTEXT;
|
||||
|
||||
|
@ -36,11 +36,6 @@
|
|||
|
||||
globalvar CURSOR, TOOLTIP, DIALOG_DEPTH_HOVER, KEYBOARD_STRING;
|
||||
globalvar UPDATE, RENDER_STACK;
|
||||
|
||||
enum ANIMATOR_END {
|
||||
loop,
|
||||
stop
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region inputs
|
||||
|
|
|
@ -53,7 +53,7 @@ function Node_2D_light(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) con
|
|||
["Render", false], 11, 10
|
||||
];
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
var _shape = inputs[| 1].getValue();
|
||||
|
||||
switch(_shape) {
|
||||
|
@ -62,14 +62,14 @@ function Node_2D_light(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) con
|
|||
var px = _x + pos[0] * _s;
|
||||
var py = _y + pos[1] * _s;
|
||||
|
||||
inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my);
|
||||
inputs[| 3].drawOverlay(active, px, py, _s, _mx, _my);
|
||||
inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
inputs[| 3].drawOverlay(active, px, py, _s, _mx, _my, _snx, _sny);
|
||||
break;
|
||||
case LIGHT_SHAPE_2D.line :
|
||||
case LIGHT_SHAPE_2D.line_asym :
|
||||
case LIGHT_SHAPE_2D.spot :
|
||||
inputs[| 6].drawOverlay(active, _x, _y, _s, _mx, _my);
|
||||
inputs[| 7].drawOverlay(active, _x, _y, _s, _mx, _my);
|
||||
inputs[| 6].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
inputs[| 7].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -142,8 +142,8 @@ function Node_3D_Obj(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
drag_mx = 0;
|
||||
drag_my = 0;
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
if(inputs[| 3].drawOverlay(active, _x, _y, _s, _mx, _my)) active = false;
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
if(inputs[| 3].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny)) active = false;
|
||||
|
||||
var _dim = inputs[| 2].getValue();
|
||||
var _pos = inputs[| 3].getValue();
|
||||
|
@ -224,7 +224,7 @@ function Node_3D_Obj(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
}
|
||||
}
|
||||
|
||||
inputs[| 3].drawOverlay(active, _x, _y, _s, _mx, _my)
|
||||
inputs[| 3].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny)
|
||||
}
|
||||
|
||||
static update = function() {
|
||||
|
|
|
@ -182,8 +182,8 @@ function Node_3D_Extrude(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
|
|||
drag_mx = 0;
|
||||
drag_my = 0;
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
if(inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my))
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
if(inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny))
|
||||
active = false;
|
||||
|
||||
var _dim = inputs[| 1].getValue();
|
||||
|
@ -265,7 +265,7 @@ function Node_3D_Extrude(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
|
|||
}
|
||||
}
|
||||
|
||||
inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my);
|
||||
inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
#region 3D setup
|
||||
|
|
|
@ -67,8 +67,8 @@ function Node_3D_Cube(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
drag_mx = 0;
|
||||
drag_my = 0;
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
if(inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my))
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
if(inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny))
|
||||
active = false;
|
||||
|
||||
var _dim = inputs[| 1].getValue();
|
||||
|
@ -150,14 +150,11 @@ function Node_3D_Cube(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
}
|
||||
}
|
||||
|
||||
inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my);
|
||||
inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static update = function() {
|
||||
var _inSurf = inputs[| 0].getValue();
|
||||
|
||||
var _ww = surface_get_width(_inSurf);
|
||||
var _hh = surface_get_height(_inSurf);
|
||||
var _dim = inputs[| 1].getValue();
|
||||
var _pos = inputs[| 2].getValue();
|
||||
var _rot = inputs[| 3].getValue();
|
||||
|
@ -171,6 +168,9 @@ function Node_3D_Cube(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
var _aclr = inputs[| 17].getValue();
|
||||
|
||||
var _usetex = inputs[| 5].getValue();
|
||||
var _ww = _usetex? _dim[0] : surface_get_width(_inSurf);
|
||||
var _hh = _usetex? _dim[1] : surface_get_height(_inSurf);
|
||||
|
||||
for(var i = 6; i <= 11; i++) inputs[| i].setVisible(_usetex);
|
||||
inputs[| 0].setVisible(true, !_usetex);
|
||||
|
||||
|
@ -212,12 +212,12 @@ function Node_3D_Cube(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
vertex_submit(PRIMITIVES[? "plane_normal"], pr_trianglelist, surface_get_texture(face[0]));
|
||||
matrix_stack_pop();
|
||||
|
||||
matrix_stack_push(matrix_build(0, 0, -0.5, 0, 0, 0, 1, 1, 1));
|
||||
matrix_stack_push(matrix_build(0, 0, -0.5, 0, 180, 0, 1, 1, 1));
|
||||
matrix_set(matrix_world, matrix_stack_top());
|
||||
vertex_submit(PRIMITIVES[? "plane_normal"], pr_trianglelist, surface_get_texture(face[1]));
|
||||
matrix_stack_pop();
|
||||
|
||||
matrix_stack_push(matrix_build(0, 0.5, 0, 90, 0, 0, 1, 1, 1));
|
||||
matrix_stack_push(matrix_build(0, 0.5, 0, -90, 0, 0, 1, 1, 1));
|
||||
matrix_set(matrix_world, matrix_stack_top());
|
||||
vertex_submit(PRIMITIVES[? "plane_normal"], pr_trianglelist, surface_get_texture(face[2]));
|
||||
matrix_stack_pop();
|
||||
|
@ -227,7 +227,7 @@ function Node_3D_Cube(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
vertex_submit(PRIMITIVES[? "plane_normal"], pr_trianglelist, surface_get_texture(face[3]));
|
||||
matrix_stack_pop();
|
||||
|
||||
matrix_stack_push(matrix_build(0.5, 0, 0, 0, 90, 0, 1, 1, 1));
|
||||
matrix_stack_push(matrix_build(0.5, 0, 0, 0, -90, 0, 1, 1, 1));
|
||||
matrix_set(matrix_world, matrix_stack_top());
|
||||
vertex_submit(PRIMITIVES[? "plane_normal"], pr_trianglelist, surface_get_texture(face[4]));
|
||||
matrix_stack_pop();
|
||||
|
|
|
@ -105,8 +105,8 @@ function Node_3D_Cylinder(_x, _y, _group = -1) : Node(_x, _y, _group) constructo
|
|||
drag_mx = 0;
|
||||
drag_my = 0;
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
if(inputs[| 3].drawOverlay(active, _x, _y, _s, _mx, _my))
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
if(inputs[| 3].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny))
|
||||
active = false;
|
||||
|
||||
var _dim = inputs[| 2].getValue();
|
||||
|
@ -188,7 +188,7 @@ function Node_3D_Cylinder(_x, _y, _group = -1) : Node(_x, _y, _group) constructo
|
|||
}
|
||||
}
|
||||
|
||||
inputs[| 3].drawOverlay(active, _x, _y, _s, _mx, _my);
|
||||
inputs[| 3].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
#region 3D setup
|
||||
|
|
|
@ -43,8 +43,8 @@ function Node_3D_Transform(_x, _y, _group = -1) : Node_Processor(_x, _y, _group)
|
|||
drag_mx = 0;
|
||||
drag_my = 0;
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
if(inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my))
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
if(inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny))
|
||||
active = false;
|
||||
var _out = outputs[| 0].getValue();
|
||||
if(!is_surface(_out) || !surface_exists(_out)) return;
|
||||
|
|
|
@ -26,7 +26,7 @@ function Node_9Slice(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) const
|
|||
}
|
||||
}
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
if(process_multiple) return;
|
||||
if(array_length(current_data) < 1) return;
|
||||
|
||||
|
@ -66,7 +66,7 @@ function Node_9Slice(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) const
|
|||
}
|
||||
}
|
||||
|
||||
if(!inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my)) {
|
||||
if(!inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny)) {
|
||||
if(distance_to_line_infinite(_mx, _my, sp_r, -hh, sp_r, hh) < 12) {
|
||||
draw_line_width(sp_r, -hh, sp_r, hh, 3);
|
||||
if(mouse_press(mb_left, active)) {
|
||||
|
|
|
@ -40,8 +40,8 @@ function Node_VFX_effector(_x, _y, _group = -1) : Node(_x, _y, _group) construct
|
|||
|
||||
current_data = [];
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my);
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
|
||||
var area = inputs[| 1].getValue();
|
||||
var cx = _x + area[0] * _s;
|
||||
|
|
|
@ -19,7 +19,7 @@ function Node_Area(_x, _y, _group = -1) : Node_Value_Processor(_x, _y, _group) c
|
|||
outputs[| 0] = nodeValue(0, "Area", self, JUNCTION_CONNECT.output, VALUE_TYPE.float, [ 0, 0, 0, 0, AREA_SHAPE.rectangle ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
var _pos = inputs[| 0].getValue();
|
||||
var _span = inputs[| 1].getValue();
|
||||
var _shape = inputs[| 2].getValue();
|
||||
|
@ -38,8 +38,8 @@ function Node_Area(_x, _y, _group = -1) : Node_Value_Processor(_x, _y, _group) c
|
|||
break;
|
||||
}
|
||||
|
||||
inputs[| 0].drawOverlay(active, _x, _y, _s, _mx, _my);
|
||||
inputs[| 1].drawOverlay(active, px, py, _s, _mx, _my);
|
||||
inputs[| 0].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
inputs[| 1].drawOverlay(active, px, py, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
function process_value_data(_data, index = 0) {
|
||||
|
|
|
@ -13,7 +13,7 @@ function Node_Blur_Directional(_x, _y, _group = -1) : Node_Processor(_x, _y, _gr
|
|||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
var _surf = outputs[| 0].getValue();
|
||||
if(is_array(_surf)) {
|
||||
if(array_length(_surf) == 0) return;
|
||||
|
@ -23,7 +23,7 @@ function Node_Blur_Directional(_x, _y, _group = -1) : Node_Processor(_x, _y, _gr
|
|||
var ww = surface_get_width(_surf);
|
||||
var hh = surface_get_height(_surf);
|
||||
|
||||
inputs[| 2].drawOverlay(active, _x + ww / 2 * _s, _y + hh / 2 * _s, _s, _mx, _my);
|
||||
inputs[| 2].drawOverlay(active, _x + ww / 2 * _s, _y + hh / 2 * _s, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
|
|
|
@ -12,13 +12,13 @@ function Node_Blur_Radial(_x, _y, _group = -1) : Node_Processor(_x, _y, _group)
|
|||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
var pos = inputs[| 2].getValue();
|
||||
var px = _x + pos[0] * _s;
|
||||
var py = _y + pos[1] * _s;
|
||||
|
||||
inputs[| 1].drawOverlay(active, px, py, _s, _mx, _my, 0, 64, THEME.anchor_scale_hori);
|
||||
inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my);
|
||||
inputs[| 1].drawOverlay(active, px, py, _s, _mx, _my, _snx, _sny, 0, 64, THEME.anchor_scale_hori);
|
||||
inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
|
|
|
@ -10,14 +10,14 @@ function Node_Camera(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) const
|
|||
|
||||
static getPreviewValue = function() { return inputs[| 0]; }
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
var _out = outputs[| 0].getValue();
|
||||
var _area = current_data[1];
|
||||
var _px = _x + (_area[0] - _area[2]) * _s;
|
||||
var _py = _y + (_area[1] - _area[3]) * _s;
|
||||
|
||||
draw_surface_ext_safe(_out, _px, _py, _s, _s);
|
||||
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my);
|
||||
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
|
|
|
@ -324,7 +324,7 @@ function Node_Canvas(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
surface_update();
|
||||
}
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
if(!active) return;
|
||||
if(keyboard_check(vk_alt)) return;
|
||||
|
||||
|
|
|
@ -33,13 +33,13 @@ function Node_Checker(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
["Render", false], 4, 5,
|
||||
];
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
var pos = inputs[| 3].getValue();
|
||||
var px = _x + pos[0] * _s;
|
||||
var py = _y + pos[1] * _s;
|
||||
|
||||
inputs[| 3].drawOverlay(active, _x, _y, _s, _mx, _my);
|
||||
inputs[| 2].drawOverlay(active, px, py, _s, _mx, _my);
|
||||
inputs[| 3].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
inputs[| 2].drawOverlay(active, px, py, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static update = function() {
|
||||
|
|
|
@ -15,12 +15,12 @@ function Node_Chromatic_Aberration(_x, _y, _group = -1) : Node_Processor(_x, _y,
|
|||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
var pos = inputs[| 1].getValue();
|
||||
var px = _x + pos[0] * _s;
|
||||
var py = _y + pos[1] * _s;
|
||||
|
||||
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my);
|
||||
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
|
|
|
@ -9,8 +9,8 @@ function Node_Sampler(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
outputs[| 1] = nodeValue(1, "Color", self, JUNCTION_CONNECT.output, VALUE_TYPE.color, c_white);
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my);
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
_input = -1;
|
||||
|
|
|
@ -227,7 +227,7 @@ function Node_Composite(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) co
|
|||
createNewSurface();
|
||||
}
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
var pad = inputs[| 0].getValue();
|
||||
var ww = overlay_w;
|
||||
var hh = overlay_h;
|
||||
|
@ -244,12 +244,8 @@ function Node_Composite(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) co
|
|||
|
||||
if(input_dragging > -1) {
|
||||
if(drag_type == 0) {
|
||||
var pos_x = dragging_sx + (_mx - dragging_mx) / _s;
|
||||
var pos_y = dragging_sy + (_my - dragging_my) / _s;
|
||||
if(keyboard_check(vk_control)) {
|
||||
pos_x = round(pos_x);
|
||||
pos_y = round(pos_y);
|
||||
}
|
||||
var pos_x = value_snap(dragging_sx + (_mx - dragging_mx) / _s, _snx);
|
||||
var pos_y = value_snap(dragging_sy + (_my - dragging_my) / _s, _sny);
|
||||
|
||||
if(inputs[| input_dragging].setValue([ pos_x, pos_y ]))
|
||||
UNDO_HOLDING = true;
|
||||
|
|
|
@ -15,7 +15,7 @@ function Node_Crop(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constru
|
|||
|
||||
static getPreviewValue = function() { return inputs[| 0]; }
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
if(array_length(current_data) < 2) return;
|
||||
|
||||
var _inSurf = current_data[0];
|
||||
|
@ -44,10 +44,10 @@ function Node_Crop(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constru
|
|||
if(drag_side > -1) {
|
||||
var vv;
|
||||
|
||||
if(drag_side == 0) vv = drag_sv - (_mx - drag_mx) / _s;
|
||||
else if(drag_side == 2) vv = drag_sv + (_mx - drag_mx) / _s;
|
||||
else if(drag_side == 1) vv = drag_sv + (_my - drag_my) / _s;
|
||||
else vv = drag_sv - (_my - drag_my) / _s;
|
||||
if(drag_side == 0) vv = value_snap(drag_sv - (_mx - drag_mx) / _s, _snx);
|
||||
else if(drag_side == 2) vv = value_snap(drag_sv + (_mx - drag_mx) / _s, _snx);
|
||||
else if(drag_side == 1) vv = value_snap(drag_sv + (_my - drag_my) / _s, _sny);
|
||||
else vv = value_snap(drag_sv - (_my - drag_my) / _s, _sny);
|
||||
|
||||
_splice[drag_side] = vv;
|
||||
if(inputs[| 1].setValue(_splice))
|
||||
|
|
|
@ -484,7 +484,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
|
|||
active_draw_index = ind;
|
||||
}
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {}
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {}
|
||||
|
||||
static getPreviewValue = function() {
|
||||
if(preview_channel > ds_list_size(outputs)) return noone;
|
||||
|
|
|
@ -17,13 +17,13 @@ function Node_Dilate(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) const
|
|||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
var pos = inputs[| 1].getValue();
|
||||
var px = _x + pos[0] * _s;
|
||||
var py = _y + pos[1] * _s;
|
||||
|
||||
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my);
|
||||
inputs[| 3].drawOverlay(active, px, py, _s, _mx, _my, 0, 1, THEME.anchor_scale_hori);
|
||||
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
inputs[| 3].drawOverlay(active, px, py, _s, _mx, _my, _snx, _sny, 0, 1, THEME.anchor_scale_hori);
|
||||
}
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
|
|
|
@ -14,7 +14,10 @@ function Node_create_Export(_x, _y, _group = -1) {
|
|||
function Node_Export(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
||||
name = "Export";
|
||||
auto_update = false;
|
||||
previewable = false;
|
||||
|
||||
w = 96;
|
||||
min_h = 0;
|
||||
playing = false;
|
||||
played = 0;
|
||||
|
||||
|
|
|
@ -46,8 +46,8 @@ function Node_Gradient(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
["Shape", false], 2, 3, 4, 6
|
||||
];
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
inputs[| 6].drawOverlay(active, _x, _y, _s, _mx, _my);
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
inputs[| 6].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static update = function() {
|
||||
|
|
|
@ -33,11 +33,11 @@ function Node_Gradient_Points(_x, _y, _group = -1) : Node(_x, _y, _group) constr
|
|||
["Colors", false], 2, 4, 6, 8,
|
||||
];
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
if(inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my)) active = false;
|
||||
if(inputs[| 3].drawOverlay(active, _x, _y, _s, _mx, _my)) active = false;
|
||||
if(inputs[| 5].drawOverlay(active, _x, _y, _s, _mx, _my)) active = false;
|
||||
if(inputs[| 7].drawOverlay(active, _x, _y, _s, _mx, _my)) active = false;
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
if(inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny)) active = false;
|
||||
if(inputs[| 3].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny)) active = false;
|
||||
if(inputs[| 5].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny)) active = false;
|
||||
if(inputs[| 7].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny)) active = false;
|
||||
}
|
||||
|
||||
static update = function() {
|
||||
|
|
|
@ -51,8 +51,8 @@ function Node_Grid(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my);
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static update = function() {
|
||||
|
|
|
@ -30,8 +30,8 @@ function Node_Grid_Hex(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my);
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static update = function() {
|
||||
|
|
|
@ -30,8 +30,8 @@ function Node_Grid_Tri(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my);
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static update = function() {
|
||||
|
|
|
@ -10,8 +10,9 @@ function Node_Image_Sheet(_x, _y, _group = -1) : Node(_x, _y, _group) constructo
|
|||
inputs[| 1] = nodeValue(1, "Sprite size", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [ 32, 32 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 2] = nodeValue(2, "Sprite amount", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 1);
|
||||
inputs[| 3] = nodeValue(3, "Sprite per row", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 4);
|
||||
inputs[| 2] = nodeValue(2, "Row", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 1); //unused
|
||||
inputs[| 3] = nodeValue(3, "Amount", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [ 1, 1 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 4] = nodeValue(4, "Offset", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [ 0, 0 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
@ -48,54 +49,43 @@ function Node_Image_Sheet(_x, _y, _group = -1) : Node(_x, _y, _group) constructo
|
|||
var fill_w = floor((ww - _offs[0]) / sh_w);
|
||||
var fill_h = floor((hh - _offs[1]) / sh_h);
|
||||
|
||||
var amo = fill_w * fill_h, row;
|
||||
if(_orie == 0) {
|
||||
row = fill_w;
|
||||
} else {
|
||||
row = fill_h;
|
||||
}
|
||||
|
||||
inputs[| 2].setValue(amo);
|
||||
inputs[| 3].setValue(row);
|
||||
if(_orie == 0)
|
||||
inputs[| 3].setValue([ fill_w, fill_h ]);
|
||||
else
|
||||
inputs[| 3].setValue([ fill_h, fill_w ]);
|
||||
|
||||
doUpdate();
|
||||
}, "Generate"] );
|
||||
|
||||
inputs[| 11] = nodeValue(11, "Sync animation", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
.setDisplay(VALUE_DISPLAY.button, [ function() {
|
||||
var _amo = inputs[| 2].getValue();
|
||||
ANIMATOR.frames_total = max(1, _amo - 1);
|
||||
var _amo = inputs[| 3].getValue();
|
||||
ANIMATOR.frames_total = max(1, _amo[0] * _amo[1]);
|
||||
}, "Sync frames"] );
|
||||
|
||||
input_display_list = [
|
||||
["Sprite", false], 0, 1, 6, 10,
|
||||
["Sheet", false], 2, 3, 9, 4, 5,
|
||||
["Sheet", false], 3, 9, 4, 5,
|
||||
["Output", false], 7, 8, 11
|
||||
];
|
||||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
|
||||
tools = [
|
||||
[ "Draw boundary", THEME.splice_draw ]
|
||||
];
|
||||
drag_type = 0;
|
||||
drag_sx = 0;
|
||||
drag_sy = 0;
|
||||
drag_mx = 0;
|
||||
drag_my = 0;
|
||||
curr_off = [0, 0];
|
||||
curr_dim = [0, 0];
|
||||
curr_amo = [0, 0];
|
||||
|
||||
bound_drag = 0;
|
||||
bound_sx = 0;
|
||||
bound_sy = 0;
|
||||
bound_mx = 0;
|
||||
bound_my = 0;
|
||||
|
||||
cell_sx = 0;
|
||||
cell_sy = 0;
|
||||
cell_cx = 0;
|
||||
cell_cy = 0;
|
||||
cell_mx = 0;
|
||||
cell_my = 0;
|
||||
static getPreviewValue = function() { return inputs[| 0]; }
|
||||
|
||||
function getSpritePosition(index) {
|
||||
var _dim = inputs[| 1].getValue();
|
||||
var _col = inputs[| 3].getValue();
|
||||
var _off = inputs[| 4].getValue();
|
||||
var _dim = curr_dim;
|
||||
var _col = curr_amo[0];
|
||||
var _off = curr_off;
|
||||
var _spa = inputs[| 5].getValue();
|
||||
var _ori = inputs[| 9].getValue();
|
||||
|
||||
|
@ -113,108 +103,145 @@ function Node_Image_Sheet(_x, _y, _group = -1) : Node(_x, _y, _group) constructo
|
|||
return [_y, _x];
|
||||
}
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
if(inputs[| 0].value_from == noone) return;
|
||||
var _inSurf = inputs[| 0].getValue();
|
||||
|
||||
var _dim = inputs[| 1].getValue();
|
||||
var _amo = inputs[| 2].getValue();
|
||||
var _off = inputs[| 4].getValue();
|
||||
|
||||
var _out = inputs[| 7].getValue();
|
||||
var _pad = inputs[| 6].getValue();
|
||||
var _spc = inputs[| 5].getValue();
|
||||
var _spd = inputs[| 8].getValue();
|
||||
if(drag_type == 0) {
|
||||
curr_dim = inputs[| 1].getValue();
|
||||
curr_amo = inputs[| 3].getValue();
|
||||
curr_off = inputs[| 4].getValue();
|
||||
}
|
||||
|
||||
var ii;
|
||||
if(_out == 0)
|
||||
ii = safe_mod(ANIMATOR.current_frame * _spd, _amo);
|
||||
else
|
||||
ii = preview_index;
|
||||
var _spr_pos = getSpritePosition(ii);
|
||||
|
||||
var _orig_x = _x - (_spr_pos[0] - _pad[2]) * _s;
|
||||
var _orig_y = _y - (_spr_pos[1] - _pad[1]) * _s;
|
||||
|
||||
draw_surface_ext_safe(_inSurf, _orig_x, _orig_y, _s, _s, 0 ,c_white, 0.25);
|
||||
|
||||
for(var i = 0; i < _amo; i++) {
|
||||
var _amo = curr_amo[0] * curr_amo[1];
|
||||
for(var i = _amo - 1; i >= 0; i--) {
|
||||
var _f = getSpritePosition(i);
|
||||
var _fx0 = _orig_x + (_f[0] - _pad[2]) * _s;
|
||||
var _fy0 = _orig_y + (_f[1] - _pad[1]) * _s;
|
||||
var _fx1 = _fx0 + _dim[0] * _s;
|
||||
var _fy1 = _fy0 + _dim[1] * _s;
|
||||
var _fx0 = _x + _f[0] * _s;
|
||||
var _fy0 = _y + _f[1] * _s;
|
||||
var _fx1 = _fx0 + curr_dim[0] * _s;
|
||||
var _fy1 = _fy0 + curr_dim[1] * _s;
|
||||
|
||||
draw_set_color(COLORS._main_accent);
|
||||
draw_rectangle(_fx0, _fy0, _fx1, _fy1, true);
|
||||
draw_set_alpha(i == 0? 1 : 0.75);
|
||||
draw_rectangle(_fx0, _fy0, _fx1 - 1, _fy1 - 1, true);
|
||||
draw_set_alpha(1);
|
||||
|
||||
//draw_set_text(f_p1, fa_left, fa_top);
|
||||
//draw_text(_fx0 + 2, _fy0 + 2, string(i));
|
||||
}
|
||||
|
||||
var _tool = PANEL_PREVIEW.tool_index;
|
||||
var _ex = (_mx - _x) / _s;
|
||||
var _ey = (_my - _y) / _s;
|
||||
var __ax = curr_off[0];
|
||||
var __ay = curr_off[1];
|
||||
var __aw = curr_dim[0];
|
||||
var __ah = curr_dim[1];
|
||||
|
||||
var _ax = __ax * _s + _x;
|
||||
var _ay = __ay * _s + _y;
|
||||
var _aw = __aw * _s;
|
||||
var _ah = __ah * _s;
|
||||
|
||||
var _bw = curr_amo[0] * (curr_dim[0] + _spc[0]) - _spc[0]; _bw *= _s;
|
||||
var _bh = curr_amo[1] * (curr_dim[1] + _spc[1]) - _spc[1]; _bh *= _s;
|
||||
|
||||
draw_sprite_ui_uniform(THEME.anchor, 0, _ax, _ay);
|
||||
draw_sprite_ui_uniform(THEME.anchor_selector, 0, _ax + _aw, _ay + _ah);
|
||||
draw_sprite_ui_uniform(THEME.anchor_arrow, 0, _ax + _bw + _s * 4, _ay + _bh / 2);
|
||||
draw_sprite_ui_uniform(THEME.anchor_arrow, 0, _ax + _bw / 2, _ay + _bh + _s * 4,,,, -90);
|
||||
|
||||
if(active) {
|
||||
if(point_in_circle(_mx, _my, _ax + _aw, _ay + _ah, 8))
|
||||
draw_sprite_ui_uniform(THEME.anchor_selector, 1, _ax + _aw, _ay + _ah);
|
||||
else if(point_in_rectangle(_mx, _my, _ax - _aw, _ay - _ah, _ax + _aw, _ay + _ah))
|
||||
draw_sprite_ui_uniform(THEME.anchor, 0, _ax, _ay, 1.25, c_white);
|
||||
else if(point_in_circle(_mx, _my, _ax + _bw + _s * 4, _ay + _bh / 2, 8))
|
||||
draw_sprite_ui_uniform(THEME.anchor_arrow, 1, _ax + _bw + _s * 4, _ay + _bh / 2);
|
||||
else if(point_in_circle(_mx, _my, _ax + _bw / 2, _ay + _bh + _s * 4, 8))
|
||||
draw_sprite_ui_uniform(THEME.anchor_arrow, 1, _ax + _bw / 2, _ay + _bh + _s * 4,,,, -90);
|
||||
}
|
||||
|
||||
#region area
|
||||
var __dim = inputs[| 1].getValue();
|
||||
var __amo = inputs[| 3].getValue();
|
||||
var __off = inputs[| 4].getValue();
|
||||
|
||||
var _ax = __off[0] * _s + _x;
|
||||
var _ay = __off[1] * _s + _y;
|
||||
var _aw = __dim[0] * _s;
|
||||
var _ah = __dim[1] * _s;
|
||||
|
||||
//draw_set_color(COLORS._main_accent);
|
||||
//draw_rectangle(_ax - _aw, _ay - _ah, _ax + _aw, _ay + _ah, true);
|
||||
|
||||
if(drag_type == 1) {
|
||||
var _xx = value_snap(round(drag_sx + (_mx - drag_mx) / _s), _snx);
|
||||
var _yy = value_snap(round(drag_sy + (_my - drag_my) / _s), _sny);
|
||||
|
||||
var off = [_xx, _yy];
|
||||
curr_off = off;
|
||||
|
||||
if(mouse_release(mb_left)) {
|
||||
drag_type = 0;
|
||||
inputs[| 4].setValue(off);
|
||||
}
|
||||
} else if(drag_type == 2) {
|
||||
var _dx = value_snap(round(abs((_mx - drag_mx) / _s)), _snx);
|
||||
var _dy = value_snap(round(abs((_my - drag_my) / _s)), _sny);
|
||||
|
||||
var dim = [_dx, _dy];
|
||||
curr_dim = dim;
|
||||
|
||||
if(_tool == 0) {
|
||||
if(bound_drag) {
|
||||
if(keyboard_check(vk_shift)) {
|
||||
cell_cx = max(2, round(cell_sx + (_ex - cell_mx)));
|
||||
cell_cy = max(2, round(cell_sy + (_ey - cell_my)));
|
||||
} else {
|
||||
bound_mx = _ex;
|
||||
bound_my = _ey;
|
||||
|
||||
cell_mx = _ex;
|
||||
cell_my = _ey;
|
||||
dim[0] = max(_dx, _dy);
|
||||
dim[1] = max(_dx, _dy);
|
||||
}
|
||||
|
||||
var fr_x0 = _x + bound_sx * _s;
|
||||
var fr_y0 = _y + bound_sy * _s;
|
||||
var fr_x1 = _x + bound_mx * _s;
|
||||
var fr_y1 = _y + bound_my * _s;
|
||||
if(mouse_release(mb_left)) {
|
||||
drag_type = 0;
|
||||
inputs[| 1].setValue(dim);
|
||||
}
|
||||
} else if(drag_type == 3) {
|
||||
var _col = floor((abs(_mx - drag_mx) / _s - _spc[0]) / (__dim[0] + _spc[0]));
|
||||
curr_amo[0] = _col;
|
||||
|
||||
var col = floor((bound_mx - bound_sx) / cell_cx);
|
||||
var row = floor((bound_my - bound_sy) / cell_cy);
|
||||
if(mouse_release(mb_left)) {
|
||||
drag_type = 0;
|
||||
inputs[| 3].setValue(curr_amo);
|
||||
}
|
||||
} else if(drag_type == 4) {
|
||||
var _row = floor((abs(_my - drag_my) / _s - _spc[1]) / (__dim[1] + _spc[1]));
|
||||
curr_amo[1] = _row;
|
||||
|
||||
draw_set_color(COLORS._main_accent);
|
||||
for( var i = 0; i < row; i++ ) {
|
||||
for( var j = 0; j < col; j++ ) {
|
||||
var cl_x0 = fr_x0 + j * (cell_cx * _s);
|
||||
var cl_y0 = fr_y0 + i * (cell_cy * _s);
|
||||
var cl_x1 = cl_x0 + (cell_cx * _s);
|
||||
var cl_y1 = cl_y0 + (cell_cy * _s);
|
||||
|
||||
draw_rectangle(cl_x0, cl_y0, cl_x1 - 1, cl_y1 - 1, 1);
|
||||
if(mouse_release(mb_left)) {
|
||||
drag_type = 0;
|
||||
inputs[| 3].setValue(curr_amo);
|
||||
}
|
||||
}
|
||||
|
||||
draw_set_color(COLORS._main_accent);
|
||||
draw_line_width(fr_x0, 0, fr_x0, room_height, 1);
|
||||
draw_line_width(0, fr_y0, room_width, fr_y0, 1);
|
||||
draw_line_width(fr_x1, 0, fr_x1, room_height, 1);
|
||||
draw_line_width(0, fr_y1, room_width, fr_y1, 1);
|
||||
|
||||
if(mouse_release(mb_left, active)) {
|
||||
bound_drag = 0;
|
||||
|
||||
if(row && col) {
|
||||
inputs[| 1].setValue([ cell_cx, cell_cy ]);
|
||||
inputs[| 2].setValue(row * col);
|
||||
inputs[| 3].setValue(col);
|
||||
inputs[| 4].setValue([ bound_sx + _off[0], bound_sy + _off[1]]);
|
||||
}
|
||||
}
|
||||
} else if(mouse_press(mb_left, active)) {
|
||||
bound_drag = 1;
|
||||
bound_sx = _ex;
|
||||
bound_sy = _ey;
|
||||
|
||||
cell_cx = _dim[0];
|
||||
cell_cy = _dim[1];
|
||||
cell_sx = _dim[0];
|
||||
cell_sy = _dim[1];
|
||||
if(mouse_press(mb_left, active)) {
|
||||
if(point_in_circle(_mx, _my, _ax + _aw, _ay + _ah, 8)) { // drag size
|
||||
drag_type = 2;
|
||||
drag_mx = _ax;
|
||||
drag_my = _ay;
|
||||
} else if(point_in_rectangle(_mx, _my, _ax - _aw, _ay - _ah, _ax + _aw, _ay + _ah)) { // drag position
|
||||
drag_type = 1;
|
||||
drag_sx = __off[0];
|
||||
drag_sy = __off[1];
|
||||
drag_mx = _mx;
|
||||
drag_my = _my;
|
||||
} else if(point_in_circle(_mx, _my, _ax + _bw + _s * 4, _ay + _bh / 2, 8)) { // drag col
|
||||
drag_type = 3;
|
||||
drag_mx = _ax;
|
||||
drag_my = _ay;
|
||||
} else if(point_in_circle(_mx, _my, _ax + _bw / 2, _ay + _bh + _s * 4, 8)) { // drag row
|
||||
drag_type = 4;
|
||||
drag_mx = _ax;
|
||||
drag_my = _ay;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
static update = function() {
|
||||
|
@ -224,7 +251,8 @@ function Node_Image_Sheet(_x, _y, _group = -1) : Node(_x, _y, _group) constructo
|
|||
var _outSurf = outputs[| 0].getValue();
|
||||
|
||||
var _dim = inputs[| 1].getValue();
|
||||
var _amo = inputs[| 2].getValue();
|
||||
var _amo = inputs[| 3].getValue();
|
||||
var _total = _amo[0] * _amo[1];
|
||||
var _pad = inputs[| 6].getValue();
|
||||
|
||||
var ww = _dim[0] + _pad[0] + _pad[2];
|
||||
|
@ -244,7 +272,7 @@ function Node_Image_Sheet(_x, _y, _group = -1) : Node(_x, _y, _group) constructo
|
|||
outputs[| 0].setValue(_outSurf);
|
||||
}
|
||||
|
||||
var ii = safe_mod(ANIMATOR.current_frame * _spd, _amo);
|
||||
var ii = safe_mod(ANIMATOR.current_frame * _spd, _total);
|
||||
var _spr_pos = getSpritePosition(ii);
|
||||
|
||||
surface_set_target(_outSurf);
|
||||
|
@ -257,8 +285,8 @@ function Node_Image_Sheet(_x, _y, _group = -1) : Node(_x, _y, _group) constructo
|
|||
update_on_frame = false;
|
||||
inputs[| 8].setVisible(false);
|
||||
|
||||
surf_array = array_create(_amo);
|
||||
for(var i = 0; i < _amo; i++) {
|
||||
surf_array = array_create(_total);
|
||||
for(var i = 0; i < _total; i++) {
|
||||
surf_array[i] = surface_create_valid(ww, hh);
|
||||
var _spr_pos = getSpritePosition(i);
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ function Node_Mirror(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) const
|
|||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
var _pos = inputs[| 1].getValue();
|
||||
var _ang = inputs[| 2].getValue();
|
||||
var _posx = _pos[0] * _s + _x;
|
||||
|
@ -28,8 +28,8 @@ function Node_Mirror(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) const
|
|||
draw_set_color(COLORS._main_accent);
|
||||
draw_line(dx0, dy0, dx1, dy1);
|
||||
|
||||
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my);
|
||||
inputs[| 2].drawOverlay(active, _posx, _posy, _s, _mx, _my);
|
||||
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
inputs[| 2].drawOverlay(active, _posx, _posy, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
|
|
|
@ -28,8 +28,8 @@ function Node_Noise_Aniso(_x, _y, _group = -1) : Node(_x, _y, _group) constructo
|
|||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
inputs[| 3].drawOverlay(active, _x, _y, _s, _mx, _my);
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
inputs[| 3].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static update = function() {
|
||||
|
|
|
@ -38,8 +38,8 @@ function Node_Cellular(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my);
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static update = function() {
|
||||
|
|
|
@ -34,8 +34,8 @@ function Node_Grid_Noise(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
|
|||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my);
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static update = function() {
|
||||
|
|
|
@ -34,13 +34,13 @@ function Node_Normal_Light(_x, _y, _group = -1) : Node_Processor(_x, _y, _group)
|
|||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
var pos = inputs[| 4].getValue();
|
||||
var px = _x + pos[0] * _s;
|
||||
var py = _y + pos[1] * _s;
|
||||
|
||||
inputs[| 4].drawOverlay(active, _x, _y, _s, _mx, _my);
|
||||
inputs[| 5].drawOverlay(active, px, py, _s, _mx, _my);
|
||||
inputs[| 4].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
inputs[| 5].drawOverlay(active, px, py, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
|
|
|
@ -41,14 +41,14 @@ function Node_Path(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
drag_point_sx = 0;
|
||||
drag_point_sy = 0;
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
var sample = PREF_MAP[? "path_resolution"];
|
||||
var loop = inputs[| 1].getValue();
|
||||
var ansize = ds_list_size(inputs) - list_start;
|
||||
|
||||
if(drag_point > -1) {
|
||||
var dx = drag_point_sx + (_mx - drag_point_mx) / _s;
|
||||
var dy = drag_point_sy + (_my - drag_point_my) / _s;
|
||||
var dx = value_snap(drag_point_sx + (_mx - drag_point_mx) / _s, _snx);
|
||||
var dy = value_snap(drag_point_sy + (_my - drag_point_my) / _s, _sny);
|
||||
|
||||
if(drag_type < 2) {
|
||||
var inp = inputs[| list_start + drag_point];
|
||||
|
@ -91,6 +91,11 @@ function Node_Path(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
var miny = min((_my - _y) / _s, (drag_point_my - _y) / _s);
|
||||
var maxy = max((_my - _y) / _s, (drag_point_my - _y) / _s);
|
||||
|
||||
minx = value_snap(minx, _snx);
|
||||
maxx = value_snap(maxx, _snx);
|
||||
miny = value_snap(miny, _sny);
|
||||
maxy = value_snap(maxy, _sny);
|
||||
|
||||
var a = [];
|
||||
for( var i = 0; i < 4; i++ )
|
||||
a[i] = inputs[| list_start + i].getValue();
|
||||
|
@ -115,6 +120,11 @@ function Node_Path(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
var miny = min((_my - _y) / _s, (drag_point_my - _y) / _s);
|
||||
var maxy = max((_my - _y) / _s, (drag_point_my - _y) / _s);
|
||||
|
||||
minx = value_snap(minx, _snx);
|
||||
maxx = value_snap(maxx, _snx);
|
||||
miny = value_snap(miny, _sny);
|
||||
maxy = value_snap(maxy, _sny);
|
||||
|
||||
var a = [];
|
||||
for( var i = 0; i < 4; i++ )
|
||||
a[i] = inputs[| list_start + i].getValue();
|
||||
|
@ -285,7 +295,7 @@ function Node_Path(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
|
||||
if(mouse_press(mb_left, active)) {
|
||||
drag_point = ds_list_size(inputs) - list_start;
|
||||
createAnchor((_mx - _x) / _s, (_my - _y) / _s);
|
||||
createAnchor(value_snap((_mx - _x) / _s, _snx), value_snap((_my - _y) / _s, _sny));
|
||||
|
||||
drag_type = -1;
|
||||
drag_point_mx = _mx;
|
||||
|
@ -307,7 +317,7 @@ function Node_Path(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
inputs[| 1].setValue(true);
|
||||
|
||||
repeat(4)
|
||||
createAnchor((_mx - _x) / _s, (_my - _y) / _s);
|
||||
createAnchor(value_snap((_mx - _x) / _s, _snx), value_snap((_my - _y) / _s, _sny));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,8 +44,8 @@ function Node_Scatter(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
|
||||
temp_surf = [ PIXEL_SURFACE, PIXEL_SURFACE ];
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
inputs[| 5].drawOverlay(active, _x, _y, _s, _mx, _my);
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
inputs[| 5].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static update = function() {
|
||||
|
|
|
@ -22,7 +22,7 @@ function Node_Shadow(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) const
|
|||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
var _surf = outputs[| 0].getValue();
|
||||
if(is_array(_surf)) {
|
||||
if(array_length(_surf) == 0) return;
|
||||
|
@ -32,7 +32,7 @@ function Node_Shadow(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) const
|
|||
var ww = surface_get_width(_surf) * _s;
|
||||
var hh = surface_get_height(_surf) * _s;
|
||||
|
||||
inputs[| 3].drawOverlay(active, _x + ww / 2, _y + hh / 2, _s, _mx, _my);
|
||||
inputs[| 3].drawOverlay(active, _x + ww / 2, _y + hh / 2, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
|
|
|
@ -67,8 +67,8 @@ function Node_Shape(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constr
|
|||
["Render", true], 10, 1, 11, 12
|
||||
];
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
inputs[| 3].drawOverlay(active, _x, _y, _s, _mx, _my);
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
inputs[| 3].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
|
|
|
@ -36,8 +36,8 @@ function Node_Skew(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constru
|
|||
inputs[| 4].setValue([ww / 2, hh / 2]);
|
||||
}
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
inputs[| 4].drawOverlay(active, _x, _y, _s, _mx, _my);
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
inputs[| 4].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
|
|
|
@ -134,6 +134,12 @@ function Node_Render_Sprite_Sheet(_x, _y, _group = -1) : Node(_x, _y, _group) co
|
|||
var alig = inputs[| 5].getValue();
|
||||
|
||||
if(grup == SPRITE_ANIM_GROUP.animation) {
|
||||
if(!LOADING && !APPENDING) {
|
||||
ANIMATOR.setFrame(-1);
|
||||
ANIMATOR.is_playing = true;
|
||||
ANIMATOR.stopOnEnd = true;
|
||||
}
|
||||
|
||||
var skip = inputs[| 2].getValue();
|
||||
|
||||
if(is_array(inpt) && array_length(inpt) == 0) return;
|
||||
|
|
|
@ -30,13 +30,13 @@ function Node_Sprite_Stack(_x, _y, _group = -1) : Node(_x, _y, _group) construct
|
|||
["Render", false], 6, 7,
|
||||
];
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
var pos = inputs[| 4].getValue();
|
||||
var px = _x + pos[0] * _s;
|
||||
var py = _y + pos[1] * _s;
|
||||
|
||||
inputs[| 4].drawOverlay(active, _x, _y, _s, _mx, _my);
|
||||
inputs[| 5].drawOverlay(active, px, py, _s, _mx, _my);
|
||||
inputs[| 4].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
inputs[| 5].drawOverlay(active, px, py, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static update = function() {
|
||||
|
|
|
@ -44,13 +44,13 @@ function Node_Stripe(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
["Render", false], 3, 6, 7
|
||||
];
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
var pos = inputs[| 4].getValue();
|
||||
var px = _x + pos[0] * _s;
|
||||
var py = _y + pos[1] * _s;
|
||||
|
||||
inputs[| 4].drawOverlay(active, _x, _y, _s, _mx, _my);
|
||||
inputs[| 2].drawOverlay(active, px, py, _s, _mx, _my);
|
||||
inputs[| 4].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
inputs[| 2].drawOverlay(active, px, py, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static update = function() {
|
||||
|
|
|
@ -21,7 +21,7 @@ function Node_Transform(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) co
|
|||
.setIcon(THEME.anchor)
|
||||
.setTooltip("Set to center"));
|
||||
|
||||
inputs[| 4] = nodeValue(4, "Relative", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true);
|
||||
inputs[| 4] = nodeValue(4, "Relative anchor", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true);
|
||||
|
||||
inputs[| 5] = nodeValue(5, "Rotation", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
.setDisplay(VALUE_DISPLAY.rotation);
|
||||
|
@ -44,7 +44,7 @@ function Node_Transform(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) co
|
|||
|
||||
inputs[| 10] = nodeValue(10, "Exact", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false);
|
||||
|
||||
inputs[| 11] = nodeValue(11, "Relative to surface", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false);
|
||||
inputs[| 11] = nodeValue(11, "Relative position", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false);
|
||||
|
||||
input_display_list = [ 0,
|
||||
["Output", true], 9, 1, 7,
|
||||
|
@ -244,7 +244,7 @@ function Node_Transform(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) co
|
|||
overlay_drag_ma = 0;
|
||||
overlay_drag_sa = 0;
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
if(array_length(current_data) < ds_list_size(inputs)) return;
|
||||
|
||||
var _surf = inputs[| 0].getValue();
|
||||
|
@ -349,10 +349,8 @@ function Node_Transform(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) co
|
|||
pos_y = overlay_drag_sy + py / _s;
|
||||
}
|
||||
|
||||
if(keyboard_check(vk_control)) {
|
||||
pos_x = round(pos_x);
|
||||
pos_y = round(pos_y);
|
||||
}
|
||||
pos_x = value_snap(pos_x, _snx);
|
||||
pos_y = value_snap(pos_y, _sny);
|
||||
|
||||
if(overlay_dragging == 1) {
|
||||
if(pos_rel) {
|
||||
|
@ -418,8 +416,9 @@ function Node_Transform(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) co
|
|||
overlay_dragging = 0;
|
||||
UNDO_HOLDING = false;
|
||||
}
|
||||
} else {
|
||||
if(mouse_press(mb_left, active)) {
|
||||
}
|
||||
|
||||
if(overlay_dragging == 0 && mouse_press(mb_left, active)) {
|
||||
if(point_in_circle(_mx, _my, bax, bay, 8)) {
|
||||
overlay_dragging = 2;
|
||||
overlay_drag_mx = _mx;
|
||||
|
@ -445,5 +444,4 @@ function Node_Transform(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) co
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -47,7 +47,7 @@ function Node_Transform_Single(_x, _y, _group = -1) : Node_Processor(_x, _y, _gr
|
|||
overlay_drag_ma = 0;
|
||||
overlay_drag_sa = 0;
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
if(array_length(current_data) < ds_list_size(inputs)) return;
|
||||
|
||||
var _surf = outputs[| 0].getValue();
|
||||
|
@ -108,8 +108,8 @@ function Node_Transform_Single(_x, _y, _group = -1) : Node_Processor(_x, _y, _gr
|
|||
#endregion
|
||||
|
||||
if(overlay_dragging && overlay_dragging < 3) {
|
||||
var px = _mx - overlay_drag_mx;
|
||||
var py = _my - overlay_drag_my;
|
||||
var px = value_snap(_mx - overlay_drag_mx, _snx);
|
||||
var py = value_snap(_my - overlay_drag_my, _sny);
|
||||
var pos_x, pos_y;
|
||||
|
||||
if(keyboard_check(vk_shift)) {
|
||||
|
|
|
@ -17,13 +17,13 @@ function Node_Twirl(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constr
|
|||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
var pos = inputs[| 1].getValue();
|
||||
var px = _x + pos[0] * _s;
|
||||
var py = _y + pos[1] * _s;
|
||||
|
||||
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my);
|
||||
inputs[| 3].drawOverlay(active, px, py, _s, _mx, _my, 0, 1, THEME.anchor_scale_hori);
|
||||
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
inputs[| 3].drawOverlay(active, px, py, _s, _mx, _my, _snx, _sny, 0, 1, THEME.anchor_scale_hori);
|
||||
}
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
|
|
|
@ -726,7 +726,7 @@ function NodeValue(_index, _name, _node, _connect, _type, _value, _tag = VALUE_T
|
|||
drag_my = 0;
|
||||
drag_sx = 0;
|
||||
drag_sy = 0;
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
var _val = getValue();
|
||||
var hover = -1;
|
||||
|
||||
|
@ -735,9 +735,9 @@ function NodeValue(_index, _name, _node, _connect, _type, _value, _tag = VALUE_T
|
|||
case VALUE_TYPE.float :
|
||||
switch(display_type) {
|
||||
case VALUE_DISPLAY._default : #region
|
||||
var _angle = argument_count > 6? argument[6] : 0;
|
||||
var _scale = argument_count > 7? argument[7] : 1;
|
||||
var spr = argument_count > 8? argument[8] : THEME.anchor_selector;
|
||||
var _angle = argument_count > 8? argument[8] : 0;
|
||||
var _scale = argument_count > 9? argument[9] : 1;
|
||||
var spr = argument_count > 10? argument[10] : THEME.anchor_selector;
|
||||
var index = 0;
|
||||
|
||||
var __ax = lengthdir_x(_val * _scale, _angle);
|
||||
|
@ -777,7 +777,7 @@ function NodeValue(_index, _name, _node, _connect, _type, _value, _tag = VALUE_T
|
|||
break;
|
||||
#endregion
|
||||
case VALUE_DISPLAY.rotation : #region
|
||||
var _rad = argument_count > 6? argument[6] : 64;
|
||||
var _rad = argument_count > 8? argument[8] : 64;
|
||||
|
||||
var _ax = _x + lengthdir_x(_rad, _val);
|
||||
var _ay = _y + lengthdir_y(_rad, _val);
|
||||
|
@ -822,11 +822,8 @@ function NodeValue(_index, _name, _node, _connect, _type, _value, _tag = VALUE_T
|
|||
break;
|
||||
#endregion
|
||||
case VALUE_DISPLAY.vector : #region
|
||||
var _psx = argument_count > 6? argument[6] : 1;
|
||||
var _psy = argument_count > 7? argument[7] : 1;
|
||||
|
||||
var __ax = _val[0] * _psx;
|
||||
var __ay = _val[1] * _psy;
|
||||
var __ax = _val[0];
|
||||
var __ay = _val[1];
|
||||
|
||||
var _ax = __ax * _s + _x;
|
||||
var _ay = __ay * _s + _y;
|
||||
|
@ -835,8 +832,8 @@ function NodeValue(_index, _name, _node, _connect, _type, _value, _tag = VALUE_T
|
|||
|
||||
if(drag_type) {
|
||||
draw_sprite_ui_uniform(THEME.anchor_selector, 1, _ax, _ay);
|
||||
var _nx = (drag_sx + (_mx - drag_mx) - _x) / _s / _psx;
|
||||
var _ny = (drag_sy + (_my - drag_my) - _y) / _s / _psy;
|
||||
var _nx = value_snap((drag_sx + (_mx - drag_mx) - _x) / _s, _snx);
|
||||
var _ny = value_snap((drag_sy + (_my - drag_my) - _y) / _s, _sny);
|
||||
if(keyboard_check(vk_control)) {
|
||||
_val[0] = round(_nx);
|
||||
_val[1] = round(_ny);
|
||||
|
@ -898,8 +895,8 @@ function NodeValue(_index, _name, _node, _connect, _type, _value, _tag = VALUE_T
|
|||
draw_sprite_ui_uniform(THEME.anchor, 0, _ax, _ay, 1.25, c_white);
|
||||
|
||||
if(drag_type == 1) {
|
||||
var _xx = drag_sx + (_mx - drag_mx) / _s;
|
||||
var _yy = drag_sy + (_my - drag_my) / _s;
|
||||
var _xx = value_snap(drag_sx + (_mx - drag_mx) / _s, _snx);
|
||||
var _yy = value_snap(drag_sy + (_my - drag_my) / _s, _sny);
|
||||
|
||||
if(keyboard_check(vk_control)) {
|
||||
_val[0] = round(_xx);
|
||||
|
@ -917,8 +914,8 @@ function NodeValue(_index, _name, _node, _connect, _type, _value, _tag = VALUE_T
|
|||
UNDO_HOLDING = false;
|
||||
}
|
||||
} else if(drag_type == 2) {
|
||||
var _dx = (_mx - drag_mx) / _s;
|
||||
var _dy = (_my - drag_my) / _s;
|
||||
var _dx = value_snap((_mx - drag_mx) / _s, _snx);
|
||||
var _dy = value_snap((_my - drag_my) / _s, _sny);
|
||||
|
||||
if(keyboard_check(vk_control)) {
|
||||
_val[2] = round(_dx);
|
||||
|
@ -1016,8 +1013,8 @@ function NodeValue(_index, _name, _node, _connect, _type, _value, _tag = VALUE_T
|
|||
|
||||
if(drag_type == 1) {
|
||||
draw_sprite_ui_uniform(THEME.anchor_selector, 1, _ax, _ay);
|
||||
var _nx = drag_sx + (_mx - drag_mx) / _s;
|
||||
var _ny = drag_sy + (_my - drag_my) / _s;
|
||||
var _nx = value_snap(drag_sx + (_mx - drag_mx) / _s, _snx);
|
||||
var _ny = value_snap(drag_sy + (_my - drag_my) / _s, _sny);
|
||||
|
||||
if(keyboard_check(vk_control)) {
|
||||
_val[PUPPET_CONTROL.cx] = round(_nx);
|
||||
|
@ -1036,8 +1033,8 @@ function NodeValue(_index, _name, _node, _connect, _type, _value, _tag = VALUE_T
|
|||
}
|
||||
} else if(drag_type == 2) {
|
||||
draw_sprite_ui_uniform(THEME.anchor_selector, 0, _ax1, _ay1);
|
||||
var _nx = drag_sx + (_mx - drag_mx) / _s;
|
||||
var _ny = drag_sy + (_my - drag_my) / _s;
|
||||
var _nx = value_snap(drag_sx + (_mx - drag_mx) / _s, _snx);
|
||||
var _ny = value_snap(drag_sy + (_my - drag_my) / _s, _sny);
|
||||
|
||||
if(keyboard_check(vk_control)) {
|
||||
_val[PUPPET_CONTROL.fx] = round(_nx);
|
||||
|
|
|
@ -6,13 +6,13 @@ function Node_Warp(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constru
|
|||
inputs[| 1] = nodeValue(1, "Top left", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0 ] )
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 2] = nodeValue(2, "Top right", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 0 ] )
|
||||
inputs[| 2] = nodeValue(2, "Top right", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ def_surf_size, 0 ] )
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 3] = nodeValue(3, "Bottom left", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 1 ] )
|
||||
inputs[| 3] = nodeValue(3, "Bottom left", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, def_surf_size ] )
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 4] = nodeValue(4, "Bottom right", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1 ] )
|
||||
inputs[| 4] = nodeValue(4, "Bottom right", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ def_surf_size, def_surf_size ] )
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
|
@ -20,9 +20,24 @@ function Node_Warp(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constru
|
|||
drag_side = -1;
|
||||
drag_mx = 0;
|
||||
drag_my = 0;
|
||||
drag_sv = 0;
|
||||
drag_s = [[0, 0], [0, 0]];
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
static onValueUpdate = function(index) {
|
||||
if(index != 0) return;
|
||||
|
||||
var _inSurf = inputs[| 0].getValue();
|
||||
if(!is_surface(_inSurf)) return;
|
||||
|
||||
var ww = surface_get_width(_inSurf);
|
||||
var hh = surface_get_height(_inSurf);
|
||||
|
||||
inputs[| 1].setValue([ 0, 0]);
|
||||
inputs[| 2].setValue([ww, 0]);
|
||||
inputs[| 3].setValue([ 0, hh]);
|
||||
inputs[| 4].setValue([ww, hh]);
|
||||
}
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
if(array_length(current_data) < ds_list_size(inputs)) return;
|
||||
|
||||
var _surf = outputs[| 0].getValue();
|
||||
|
@ -31,22 +46,20 @@ function Node_Warp(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constru
|
|||
_surf = _surf[preview_index];
|
||||
}
|
||||
|
||||
var ww = surface_get_width(_surf);
|
||||
var hh = surface_get_height(_surf);
|
||||
var tl = current_data[1];
|
||||
var tr = current_data[2];
|
||||
var bl = current_data[3];
|
||||
var br = current_data[4];
|
||||
|
||||
tl[0] = _x + tl[0] * ww * _s;
|
||||
tr[0] = _x + tr[0] * ww * _s;
|
||||
bl[0] = _x + bl[0] * ww * _s;
|
||||
br[0] = _x + br[0] * ww * _s;
|
||||
tl[0] = _x + tl[0] * _s;
|
||||
tr[0] = _x + tr[0] * _s;
|
||||
bl[0] = _x + bl[0] * _s;
|
||||
br[0] = _x + br[0] * _s;
|
||||
|
||||
tl[1] = _y + tl[1] * hh * _s;
|
||||
tr[1] = _y + tr[1] * hh * _s;
|
||||
bl[1] = _y + bl[1] * hh * _s;
|
||||
br[1] = _y + br[1] * hh * _s;
|
||||
tl[1] = _y + tl[1] * _s;
|
||||
tr[1] = _y + tr[1] * _s;
|
||||
bl[1] = _y + bl[1] * _s;
|
||||
br[1] = _y + br[1] * _s;
|
||||
|
||||
draw_set_color(COLORS._main_accent);
|
||||
draw_line(tl[0], tl[1], tr[0], tr[1]);
|
||||
|
@ -54,23 +67,17 @@ function Node_Warp(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constru
|
|||
draw_line(br[0], br[1], tr[0], tr[1]);
|
||||
draw_line(br[0], br[1], bl[0], bl[1]);
|
||||
|
||||
if(inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, ww, hh))
|
||||
active = false;
|
||||
if(inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my, ww, hh))
|
||||
active = false;
|
||||
if(inputs[| 3].drawOverlay(active, _x, _y, _s, _mx, _my, ww, hh))
|
||||
active = false;
|
||||
if(inputs[| 4].drawOverlay(active, _x, _y, _s, _mx, _my, ww, hh))
|
||||
active = false;
|
||||
if(inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny)) active = false;
|
||||
if(inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny)) active = false;
|
||||
if(inputs[| 3].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny)) active = false;
|
||||
if(inputs[| 4].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny)) active = false;
|
||||
|
||||
var dx = 0;
|
||||
var dy = 0;
|
||||
|
||||
if(drag_side > -1) {
|
||||
dx = (_mx - drag_mx) / _s / ww;
|
||||
dy = (_my - drag_my) / _s / hh;
|
||||
drag_mx = _mx;
|
||||
drag_my = _my;
|
||||
dx = (_mx - drag_mx) / _s;
|
||||
dy = (_my - drag_my) / _s;
|
||||
|
||||
if(mouse_release(mb_left)) {
|
||||
drag_side = -1;
|
||||
|
@ -82,48 +89,48 @@ function Node_Warp(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constru
|
|||
if(drag_side == 0) {
|
||||
draw_line_width(tl[0], tl[1], tr[0], tr[1], 3);
|
||||
|
||||
var _tlx = current_data[1][0] + dx;
|
||||
var _tly = current_data[1][1] + dy;
|
||||
var _tlx = value_snap(drag_s[0][0] + dx, _snx);
|
||||
var _tly = value_snap(drag_s[0][1] + dy, _sny);
|
||||
|
||||
var _trx = current_data[2][0] + dx;
|
||||
var _try = current_data[2][1] + dy;
|
||||
var _trx = value_snap(drag_s[1][0] + dx, _snx);
|
||||
var _try = value_snap(drag_s[1][1] + dy, _sny);
|
||||
|
||||
inputs[| 1].setValue([ _tlx, _tly ])
|
||||
if(inputs[| 2].setValue([ _trx, _try ])) UNDO_HOLDING = true;
|
||||
} else if(drag_side == 1) {
|
||||
draw_line_width(tl[0], tl[1], bl[0], bl[1], 3);
|
||||
|
||||
var _tlx = current_data[1][0] + dx;
|
||||
var _tly = current_data[1][1] + dy;
|
||||
var _tlx = value_snap(drag_s[0][0] + dx, _snx);
|
||||
var _tly = value_snap(drag_s[0][1] + dy, _sny);
|
||||
|
||||
var _blx = current_data[3][0] + dx;
|
||||
var _bly = current_data[3][1] + dy;
|
||||
var _blx = value_snap(drag_s[1][0] + dx, _snx);
|
||||
var _bly = value_snap(drag_s[1][1] + dy, _sny);
|
||||
|
||||
inputs[| 1].setValue([ _tlx, _tly ]);
|
||||
if(inputs[| 3].setValue([ _blx, _bly ])) UNDO_HOLDING = true;
|
||||
} else if(drag_side == 2) {
|
||||
draw_line_width(br[0], br[1], tr[0], tr[1], 3);
|
||||
|
||||
var _brx = current_data[4][0] + dx;
|
||||
var _bry = current_data[4][1] + dy;
|
||||
var _brx = value_snap(drag_s[0][0] + dx, _snx);
|
||||
var _bry = value_snap(drag_s[0][1] + dy, _sny);
|
||||
|
||||
var _trx = current_data[2][0] + dx;
|
||||
var _try = current_data[2][1] + dy;
|
||||
var _trx = value_snap(drag_s[1][0] + dx, _snx);
|
||||
var _try = value_snap(drag_s[1][1] + dy, _sny);
|
||||
|
||||
inputs[| 4].setValue([ _brx, _bry ]);
|
||||
if(inputs[| 2].setValue([ _trx, _try ])) UNDO_HOLDING = true;
|
||||
} else if(drag_side == 3) {
|
||||
draw_line_width(br[0], br[1], bl[0], bl[1], 3);
|
||||
|
||||
var _brx = current_data[4][0] + dx;
|
||||
var _bry = current_data[4][1] + dy;
|
||||
var _brx = value_snap(drag_s[0][0] + dx, _snx);
|
||||
var _bry = value_snap(drag_s[0][1] + dy, _sny);
|
||||
|
||||
var _blx = current_data[3][0] + dx;
|
||||
var _bly = current_data[3][1] + dy;
|
||||
var _blx = value_snap(drag_s[1][0] + dx, _snx);
|
||||
var _bly = value_snap(drag_s[1][1] + dy, _sny);
|
||||
|
||||
inputs[| 4].setValue([ _brx, _bry ]);
|
||||
if(inputs[| 3].setValue([ _blx, _bly ])) UNDO_HOLDING = true;
|
||||
} else {
|
||||
} else if(active) {
|
||||
draw_set_color(COLORS._main_accent);
|
||||
if(distance_to_line_infinite(_mx, _my, tl[0], tl[1], tr[0], tr[1]) < 12) {
|
||||
draw_line_width(tl[0], tl[1], tr[0], tr[1], 3);
|
||||
|
@ -131,6 +138,7 @@ function Node_Warp(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constru
|
|||
drag_side = 0;
|
||||
drag_mx = _mx;
|
||||
drag_my = _my;
|
||||
drag_s = [ current_data[1], current_data[2] ];
|
||||
}
|
||||
} else if(distance_to_line_infinite(_mx, _my, tl[0], tl[1], bl[0], bl[1]) < 12) {
|
||||
draw_line_width(tl[0], tl[1], bl[0], bl[1], 3);
|
||||
|
@ -138,6 +146,7 @@ function Node_Warp(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constru
|
|||
drag_side = 1;
|
||||
drag_mx = _mx;
|
||||
drag_my = _my;
|
||||
drag_s = [ current_data[1], current_data[3] ];
|
||||
}
|
||||
} else if(distance_to_line_infinite(_mx, _my, br[0], br[1], tr[0], tr[1]) < 12) {
|
||||
draw_line_width(br[0], br[1], tr[0], tr[1], 3);
|
||||
|
@ -145,6 +154,7 @@ function Node_Warp(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constru
|
|||
drag_side = 2;
|
||||
drag_mx = _mx;
|
||||
drag_my = _my;
|
||||
drag_s = [ current_data[4], current_data[2] ];
|
||||
}
|
||||
} else if(distance_to_line_infinite(_mx, _my, br[0], br[1], bl[0], bl[1]) < 12) {
|
||||
draw_line_width(br[0], br[1], bl[0], bl[1], 3);
|
||||
|
@ -152,14 +162,18 @@ function Node_Warp(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constru
|
|||
drag_side = 3;
|
||||
drag_mx = _mx;
|
||||
drag_my = _my;
|
||||
}
|
||||
drag_s = [ current_data[4], current_data[3] ];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
inputs[| 3].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
inputs[| 4].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
var ww = surface_get_width(_data[0]);
|
||||
var hh = surface_get_height(_data[0]);
|
||||
var tl = _data[1];
|
||||
var tr = _data[2];
|
||||
var bl = _data[3];
|
||||
|
@ -175,14 +189,14 @@ function Node_Warp(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constru
|
|||
|
||||
var res = 4;
|
||||
var _i0, _i1, _j0, _j1;
|
||||
var tl_x = tl[0] * ww;
|
||||
var tl_y = tl[1] * hh;
|
||||
var tr_x = tr[0] * ww;
|
||||
var tr_y = tr[1] * hh;
|
||||
var bl_x = bl[0] * ww;
|
||||
var bl_y = bl[1] * hh;
|
||||
var br_x = br[0] * ww;
|
||||
var br_y = br[1] * hh;
|
||||
var tl_x = tl[0];
|
||||
var tl_y = tl[1];
|
||||
var tr_x = tr[0];
|
||||
var tr_y = tr[1];
|
||||
var bl_x = bl[0];
|
||||
var bl_y = bl[1];
|
||||
var br_x = br[0];
|
||||
var br_y = br[1];
|
||||
|
||||
for( var i = 0; i < res; i++ ) {
|
||||
for( var j = 0; j < res; j++ ) {
|
||||
|
|
|
@ -7,8 +7,8 @@ function Node_Wrap_Area(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) co
|
|||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my);
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
|
|
|
@ -47,7 +47,7 @@ function Node_Mesh_Warp(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
|
|||
|
||||
attributes[? "pin"] = ds_map_create();
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
for(var i = 0; i < ds_list_size(data.tris); i++) {
|
||||
data.tris[| i].drawPoints(_x, _y, _s);
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ function Node_Mesh_Warp(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
|
|||
|
||||
var hover = -1;
|
||||
for(var i = control_index; i < ds_list_size(inputs); i++) {
|
||||
if(inputs[| i].drawOverlay(active, _x, _y, _s, _mx, _my))
|
||||
if(inputs[| i].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny))
|
||||
hover = i;
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,7 @@ function Node_Mesh_Warp(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
|
|||
if(mouse_press(mb_left)) {
|
||||
if(hover == -1) {
|
||||
var i = createControl();
|
||||
i.setValue( [PUPPET_FORCE_MODE.move, (_mx - _x) / _s, (_my - _y) / _s, 0, 0, 8, 8] );
|
||||
i.setValue( [PUPPET_FORCE_MODE.move, value_snap(_mx - _x, _snx) / _s, value_snap(_my - _y, _sny) / _s, 0, 0, 8, 8] );
|
||||
i.drag_type = 2;
|
||||
i.drag_sx = 0;
|
||||
i.drag_sy = 0;
|
||||
|
|
|
@ -31,8 +31,8 @@ function Node_Zigzag(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
["Render", false], 3, 4, 5,
|
||||
];
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my) {
|
||||
inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my);
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static update = function() {
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
self.onClick = noone;
|
||||
|
||||
self.time = string_lead_zero(current_hour, 2) + ":" + string_lead_zero(current_minute, 2);
|
||||
self.time = string_lead_zero(current_hour, 2) + ":" + string_lead_zero(current_minute, 2) + "." + string_lead_zero(current_second, 2);
|
||||
}
|
||||
|
||||
function noti_status(str, icon = noone) {
|
||||
|
|
|
@ -58,6 +58,7 @@ function Panel_Collection() : PanelContent() constructor {
|
|||
var hh = 0;
|
||||
var frame = current_time * PREF_MAP[? "collection_preview_speed"] / 3000;
|
||||
var _cw = contentPane.surface_w;
|
||||
var _hover = pHOVER && contentPane.hover;
|
||||
|
||||
if(contentView == 0) {
|
||||
var grid_size = ui(64);
|
||||
|
@ -83,7 +84,7 @@ function Panel_Collection() : PanelContent() constructor {
|
|||
draw_sprite_stretched(THEME.node_bg, 0, _boxx, yy, grid_size, grid_size);
|
||||
BLEND_NORMAL
|
||||
|
||||
if(pHOVER && point_in_rectangle(_m[0], _m[1], _nx, yy, _nx + grid_width, yy + grid_size)) {
|
||||
if(_hover && point_in_rectangle(_m[0], _m[1], _nx, yy, _nx + grid_width, yy + grid_size)) {
|
||||
draw_sprite_stretched_ext(THEME.node_active, 0, _boxx, yy, grid_size, grid_size, COLORS._main_accent, 1);
|
||||
if(mouse_press(mb_left, pFOCUS))
|
||||
file_dragging = _node;
|
||||
|
@ -135,7 +136,7 @@ function Panel_Collection() : PanelContent() constructor {
|
|||
BLEND_NORMAL
|
||||
}
|
||||
|
||||
if(pHOVER && point_in_rectangle(_m[0], _m[1], 0, yy, list_width, yy + list_height - 1)) {
|
||||
if(_hover && point_in_rectangle(_m[0], _m[1], 0, yy, list_width, yy + list_height - 1)) {
|
||||
draw_sprite_stretched_ext(THEME.node_active, 0, ui(4), yy, list_width - ui(8), list_height, COLORS._main_accent, 1);
|
||||
if(mouse_press(mb_left, pFOCUS))
|
||||
file_dragging = _node;
|
||||
|
@ -180,7 +181,7 @@ function Panel_Collection() : PanelContent() constructor {
|
|||
var hh = ui(8);
|
||||
|
||||
for(var i = 0; i < ds_list_size(root.subDir); i++) {
|
||||
var hg = root.subDir[| i].draw(self, ui(8), _y, _m, folderPane.w - ui(20), pHOVER, pFOCUS, root);
|
||||
var hg = root.subDir[| i].draw(self, ui(8), _y, _m, folderPane.w - ui(20), pHOVER && folderPane.hover, pFOCUS, root);
|
||||
hh += hg;
|
||||
_y += hg;
|
||||
}
|
||||
|
|
|
@ -458,13 +458,11 @@ function Panel_Graph() : PanelContent() constructor {
|
|||
}
|
||||
}
|
||||
|
||||
if(node_hovering && node_hovering.on_dragdrop_file != -1) {
|
||||
if(node_hovering && node_hovering.on_dragdrop_file != -1)
|
||||
node_hovering.drawActive(gr_x, gr_y, graph_s, 1);
|
||||
}
|
||||
|
||||
if(node_focus) {
|
||||
if(node_focus)
|
||||
node_focus.drawActive(gr_x, gr_y, graph_s);
|
||||
}
|
||||
|
||||
for(var i = 0; i < ds_list_size(nodes_select_list); i++) {
|
||||
var _node = nodes_select_list[| i];
|
||||
|
@ -477,7 +475,8 @@ function Panel_Graph() : PanelContent() constructor {
|
|||
var _hov = nodes_list[| i].drawConnections(gr_x, gr_y, graph_s, mx, my, hoverable);
|
||||
if(_hov != noone) hov = _hov;
|
||||
}
|
||||
junction_hovering = hov;
|
||||
|
||||
junction_hovering = node_hovering == noone? hov : noone;
|
||||
|
||||
value_focus = noone;
|
||||
|
||||
|
@ -876,16 +875,10 @@ function Panel_Graph() : PanelContent() constructor {
|
|||
|
||||
if(_outp == -1) return;
|
||||
|
||||
var _export;
|
||||
if(_path == -1)
|
||||
_export = nodeBuild("Node_Export", _node.x + _node.w + 64, _node.y);
|
||||
else {
|
||||
_export = new Node_Export(_node.x + _node.w + 64, _node.y);
|
||||
var _export = nodeBuild("Node_Export", _node.x + _node.w + 64, _node.y);
|
||||
if(_path != -1)
|
||||
_export.inputs[| 1].setFrom(_path);
|
||||
|
||||
ds_list_add(PANEL_GRAPH.nodes_list, _export);
|
||||
}
|
||||
|
||||
_export.inputs[| 0].setFrom(_outp);
|
||||
}
|
||||
|
||||
|
|
|
@ -82,6 +82,7 @@ function Panel_Inspector() : PanelContent() constructor {
|
|||
var jun = noone;
|
||||
var amo = inspecting.input_display_list == -1? ds_list_size(inspecting.inputs) : array_length(inspecting.input_display_list);
|
||||
var hh = ui(8);
|
||||
var _hover = pHOVER && contentPane.hover;
|
||||
|
||||
for(var i = 0; i < amo; i++) {
|
||||
var xc = con_w / 2;
|
||||
|
@ -95,7 +96,7 @@ function Panel_Inspector() : PanelContent() constructor {
|
|||
var txt = jun_disp[0];
|
||||
var coll = jun_disp[1] && filter_text == "";
|
||||
|
||||
if(pHOVER && point_in_rectangle(_m[0], _m[1], 0, yy, con_w, yy + ui(32))) {
|
||||
if(_hover && point_in_rectangle(_m[0], _m[1], 0, yy, con_w, yy + ui(32))) {
|
||||
draw_sprite_stretched_ext(THEME.group_label, 0, 0, yy, con_w, ui(32), COLORS.panel_inspector_group_hover, 1);
|
||||
|
||||
if(mouse_press(mb_left, pFOCUS))
|
||||
|
@ -128,9 +129,7 @@ function Panel_Inspector() : PanelContent() constructor {
|
|||
}
|
||||
continue;
|
||||
} else if(is_struct(jun_disp) && instanceof(jun_disp) == "Inspector_Custom_Renderer") {
|
||||
var hov = pHOVER;
|
||||
var foc = pFOCUS;
|
||||
jun_disp.draw(ui(6), yy, con_w - ui(12), _m, hov, foc);
|
||||
jun_disp.draw(ui(6), yy, con_w - ui(12), _m, _hover, pFOCUS);
|
||||
hh += jun_disp.h + ui(20);
|
||||
continue;
|
||||
}
|
||||
|
@ -150,7 +149,7 @@ function Panel_Inspector() : PanelContent() constructor {
|
|||
var butx = ui(16);
|
||||
var index = jun.value_from == noone? jun.animator.is_anim : 2;
|
||||
draw_sprite_ui_uniform(THEME.animate_clock, index, butx, lb_y, 1,, 0.8);
|
||||
if(pHOVER && point_in_circle(_m[0], _m[1], butx, lb_y, ui(10))) {
|
||||
if(_hover && point_in_circle(_m[0], _m[1], butx, lb_y, ui(10))) {
|
||||
draw_sprite_ui_uniform(THEME.animate_clock, index, butx, lb_y, 1,, 1);
|
||||
TOOLTIP = "Toggle animation";
|
||||
|
||||
|
@ -166,7 +165,7 @@ function Panel_Inspector() : PanelContent() constructor {
|
|||
butx += ui(20);
|
||||
index = jun.visible;
|
||||
draw_sprite_ui_uniform(THEME.junc_visible, index, butx, lb_y, 1,, 0.8);
|
||||
if(pHOVER && point_in_circle(_m[0], _m[1], butx, lb_y, ui(10))) {
|
||||
if(_hover && point_in_circle(_m[0], _m[1], butx, lb_y, ui(10))) {
|
||||
draw_sprite_ui_uniform(THEME.junc_visible, index, butx, lb_y, 1,, 1);
|
||||
TOOLTIP = "Visibility";
|
||||
|
||||
|
@ -175,14 +174,14 @@ function Panel_Inspector() : PanelContent() constructor {
|
|||
}
|
||||
|
||||
draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text);
|
||||
draw_text(ui(56), lb_y - ui(2), jun.name);
|
||||
draw_text_add(ui(56), lb_y - ui(2), jun.name);
|
||||
var lb_w = string_width(jun.name) + ui(32);
|
||||
|
||||
#region anim
|
||||
if(lineBreak && jun.animator.is_anim) {
|
||||
var bx = w - ui(64);
|
||||
var by = lb_y;
|
||||
if(buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, pFOCUS, pHOVER, "", THEME.prop_keyframe, 2) == 2) {
|
||||
if(buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, pFOCUS, _hover, "", THEME.prop_keyframe, 2) == 2) {
|
||||
for(var j = 0; j < ds_list_size(jun.animator.values); j++) {
|
||||
var _key = jun.animator.values[| j];
|
||||
if(_key.time > ANIMATOR.current_frame) {
|
||||
|
@ -203,7 +202,7 @@ function Panel_Inspector() : PanelContent() constructor {
|
|||
}
|
||||
}
|
||||
|
||||
if(buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, pFOCUS, pHOVER, kfFocus? "Remove keyframe" : "Add keyframe", THEME.prop_keyframe, 1, cc) == 2) {
|
||||
if(buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, pFOCUS, _hover, kfFocus? "Remove keyframe" : "Add keyframe", THEME.prop_keyframe, 1, cc) == 2) {
|
||||
var _add = false;
|
||||
for(var j = 0; j < ds_list_size(jun.animator.values); j++) {
|
||||
var _key = jun.animator.values[| j];
|
||||
|
@ -222,7 +221,7 @@ function Panel_Inspector() : PanelContent() constructor {
|
|||
}
|
||||
|
||||
bx -= ui(26);
|
||||
if(buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, pFOCUS, pHOVER, "", THEME.prop_keyframe, 0) == 2) {
|
||||
if(buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, pFOCUS, _hover, "", THEME.prop_keyframe, 0) == 2) {
|
||||
var _t = -1;
|
||||
for(var j = 0; j < ds_list_size(jun.animator.values); j++) {
|
||||
var _key = jun.animator.values[| j];
|
||||
|
@ -241,7 +240,7 @@ function Panel_Inspector() : PanelContent() constructor {
|
|||
draw_line(bx - ui(20), by - lhf, bx - ui(20), by + lhf);
|
||||
|
||||
bx -= ui(26 + 12);
|
||||
if(buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, pFOCUS, pHOVER, "Looping mode " + ON_END_NAME[jun.on_end], THEME.prop_on_end, jun.on_end) == 2)
|
||||
if(buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, pFOCUS, _hover, "Looping mode " + ON_END_NAME[jun.on_end], THEME.prop_on_end, jun.on_end) == 2)
|
||||
jun.on_end = safe_mod(jun.on_end + 1, sprite_get_number(THEME.prop_on_end));
|
||||
}
|
||||
#endregion
|
||||
|
@ -261,7 +260,7 @@ function Panel_Inspector() : PanelContent() constructor {
|
|||
|
||||
if(jun.editWidget) {
|
||||
jun.editWidget.active = pFOCUS;
|
||||
jun.editWidget.hover = pHOVER;
|
||||
jun.editWidget.hover = _hover;
|
||||
|
||||
switch(jun.display_type) {
|
||||
case VALUE_DISPLAY.button :
|
||||
|
@ -343,7 +342,7 @@ function Panel_Inspector() : PanelContent() constructor {
|
|||
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 && pHOVER && point_in_rectangle(_m[0], _m[1], icx - ui(17), icy - ui(17), icx + ui(17), icy + ui(17)))
|
||||
if(!pathExist && _hover && point_in_rectangle(_m[0], _m[1], icx - ui(17), icy - ui(17), icx + ui(17), icy + ui(17)))
|
||||
TOOLTIP = "File not exist";
|
||||
break;
|
||||
case VALUE_DISPLAY.path_font :
|
||||
|
@ -372,7 +371,7 @@ function Panel_Inspector() : PanelContent() constructor {
|
|||
}
|
||||
} else if(jun.display_type == VALUE_DISPLAY.label) {
|
||||
draw_set_text(f_p1, fa_left, fa_top, COLORS._main_text_sub);
|
||||
draw_text(ui(32), _hsy, jun.display_data);
|
||||
draw_text_add(ui(32), _hsy, jun.display_data);
|
||||
|
||||
widH = string_height(jun.display_data);
|
||||
}
|
||||
|
@ -395,7 +394,7 @@ function Panel_Inspector() : PanelContent() constructor {
|
|||
var _selY1 = yy + lb_h + widH + ui(2);
|
||||
var _selH = _selY1 - _selY;
|
||||
|
||||
if(pHOVER && point_in_rectangle(_m[0], _m[1], 4, _selY, contentPane.surface_w - ui(4), _selY + _selH)) {
|
||||
if(_hover && point_in_rectangle(_m[0], _m[1], 4, _selY, contentPane.surface_w - ui(4), _selY + _selH)) {
|
||||
draw_sprite_stretched_ext(THEME.prop_selecting, 0, 4, _selY, contentPane.surface_w - ui(8), _selH, COLORS._main_accent, 1);
|
||||
if(anim_toggling) {
|
||||
jun.animator.is_anim = !jun.animator.is_anim;
|
||||
|
@ -471,7 +470,7 @@ function Panel_Inspector() : PanelContent() constructor {
|
|||
var bx = w - ui(44);
|
||||
var by = ui(12);
|
||||
|
||||
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, "Execute node", THEME.sequence_control, 1) == 2)
|
||||
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, "Execute node", THEME.sequence_control, 1, COLORS._main_value_positive) == 2)
|
||||
inspecting.doUpdate();
|
||||
}
|
||||
|
||||
|
|
|
@ -156,7 +156,7 @@ function Panel_Menu() : PanelContent() constructor {
|
|||
}
|
||||
|
||||
draw_set_text(f_p1, fa_center, fa_center, COLORS._main_text);
|
||||
draw_text(xx + ww / 2, y + h / 2, menus[i][0]);
|
||||
draw_text_add(xx + ww / 2, y + h / 2, menus[i][0]);
|
||||
|
||||
xx += ww + 8;
|
||||
}
|
||||
|
|
|
@ -35,6 +35,7 @@ function Panel_Preview() : PanelContent() constructor {
|
|||
preview_rate = 10;
|
||||
|
||||
grid_show = false;
|
||||
grid_snap = false;
|
||||
grid_width = 16;
|
||||
grid_height = 16;
|
||||
grid_opacity = 0.5;
|
||||
|
@ -146,6 +147,7 @@ function Panel_Preview() : PanelContent() constructor {
|
|||
|
||||
var _prev_val = node.getPreviewValue();
|
||||
|
||||
if(_prev_val == undefined) continue;
|
||||
if(_prev_val == noone) continue;
|
||||
if(_prev_val.type != VALUE_TYPE.surface) continue;
|
||||
|
||||
|
@ -493,7 +495,19 @@ function Panel_Preview() : PanelContent() constructor {
|
|||
}
|
||||
}
|
||||
|
||||
_node.drawOverlay(active && isHover, canvas_x + _node.preview_x * canvas_s, canvas_y + _node.preview_y * canvas_s, canvas_s, _mx, _my);
|
||||
var cx = canvas_x + _node.preview_x * canvas_s;
|
||||
var cy = canvas_y + _node.preview_y * canvas_s;
|
||||
var _snx = 0, _sny = 0;
|
||||
|
||||
if(keyboard_check(vk_control)) {
|
||||
_snx = grid_show? grid_width : 1;
|
||||
_sny = grid_show? grid_height : 1;
|
||||
} else if(grid_snap) {
|
||||
_snx = grid_width;
|
||||
_sny = grid_height;
|
||||
}
|
||||
|
||||
_node.drawOverlay(active && isHover, cx, cy, canvas_s, _mx, _my, _snx, _sny);
|
||||
|
||||
if(_node.tools != -1) {
|
||||
var xx = ui(16);
|
||||
|
|
|
@ -42,9 +42,8 @@ function scrollBox(_data, _onModify) constructor {
|
|||
}
|
||||
if(mouse_click(mb_left, active))
|
||||
draw_sprite_stretched(THEME.textbox, 2, _x, _y, ww, _h);
|
||||
} else {
|
||||
} else
|
||||
draw_sprite_stretched(THEME.textbox, 0, _x, _y, ww, _h);
|
||||
}
|
||||
|
||||
draw_set_text(f_p0, align, fa_center, COLORS._main_text);
|
||||
if(align == fa_center)
|
||||
|
|
|
@ -12,12 +12,14 @@ function scrollPane(_w, _h, ondraw) constructor {
|
|||
drawFunc = ondraw;
|
||||
|
||||
content_h = 0;
|
||||
hover = false;
|
||||
is_scroll = true;
|
||||
|
||||
scroll_step = 64;
|
||||
active = false;
|
||||
|
||||
is_scrolling = false;
|
||||
scroll_ms = 0;
|
||||
|
||||
static resize = function(_w, _h) {
|
||||
w = _w;
|
||||
|
@ -35,11 +37,7 @@ function scrollPane(_w, _h, ondraw) constructor {
|
|||
|
||||
static draw = function(x, y, _mx = mouse_mx - x, _my = mouse_my - y) {
|
||||
var mx = _mx, my = _my;
|
||||
|
||||
if(!point_in_rectangle(mx, my, 0, 0, surface_w, surface_h)) {
|
||||
mx = -100;
|
||||
my = -100;
|
||||
}
|
||||
hover = point_in_rectangle(mx, my, 0, 0, surface_w, surface_h);
|
||||
|
||||
if(!is_surface(surface)) surface = surface_create_valid(surface_w, surface_h);
|
||||
surface_set_target(surface);
|
||||
|
@ -53,7 +51,6 @@ function scrollPane(_w, _h, ondraw) constructor {
|
|||
if(sc != is_scroll)
|
||||
resize(w, h);
|
||||
|
||||
scroll_y_to = clamp(scroll_y_to, -content_h, 0);
|
||||
scroll_y_raw = lerp_float(scroll_y_raw, scroll_y_to, 4);
|
||||
scroll_y = round(scroll_y_raw);
|
||||
draw_surface_safe(surface, x, y);
|
||||
|
@ -64,43 +61,55 @@ function scrollPane(_w, _h, ondraw) constructor {
|
|||
}
|
||||
|
||||
if(abs(content_h) > 0) {
|
||||
draw_scroll(x + surface_w + ui(4), y + ui(6), true, surface_h - ui(12), -scroll_y / content_h, surface_h / (surface_h + content_h), COLORS.scrollbar_idle, COLORS.scrollbar_hover, x + _mx, y + _my);
|
||||
draw_scroll(x + surface_w + ui(4), y + ui(6), true, surface_h - ui(12), -scroll_y / content_h, surface_h / (surface_h + content_h),
|
||||
COLORS.scrollbar_bg, COLORS.scrollbar_idle, COLORS.scrollbar_hover, x + _mx, y + _my);
|
||||
}
|
||||
}
|
||||
|
||||
static draw_scroll = function(scr_x, scr_y, is_vert, scr_s, scr_prog, scr_size, bar_col, bar_hcol, mx, my) {
|
||||
var scr_scale_s = scr_s * scr_size;
|
||||
static draw_scroll = function(scr_x, scr_y, is_vert, scr_s, scr_prog, scr_ratio, bg_col, bar_col, bar_hcol, mx, my) {
|
||||
var scr_scale_s = scr_s * scr_ratio;
|
||||
var scr_prog_s = scr_prog * (scr_s - scr_scale_s);
|
||||
var scr_w, scr_h, bar_w, bar_h, bar_x, bar_y;
|
||||
|
||||
if(is_vert) {
|
||||
scr_w = ui(sprite_get_width(THEME.ui_scrollbar));
|
||||
scr_h = scr_s;
|
||||
|
||||
bar_w = ui(sprite_get_width(THEME.ui_scrollbar));
|
||||
bar_h = scr_scale_s;
|
||||
|
||||
bar_x = scr_x;
|
||||
bar_y = scr_y + scr_prog_s;
|
||||
} else {
|
||||
scr_w = scr_s;
|
||||
scr_h = ui(sprite_get_width(THEME.ui_scrollbar));
|
||||
|
||||
bar_w = scr_scale_s;
|
||||
bar_h = ui(sprite_get_width(THEME.ui_scrollbar));
|
||||
|
||||
bar_x = scr_x + scr_prog_s;
|
||||
bar_y = scr_y;
|
||||
}
|
||||
|
||||
if(is_scrolling) {
|
||||
var delta = (is_vert? my : mx) - scroll_ms;
|
||||
scroll_ms = is_vert? my : mx;
|
||||
|
||||
scroll_y_to -= (delta / scr_scale_s) * scr_s;
|
||||
scroll_y_to = clamp(scroll_y_to, -content_h, 0);
|
||||
|
||||
if(mouse_release(mb_left))
|
||||
is_scrolling = false;
|
||||
}
|
||||
|
||||
draw_sprite_stretched_ext(THEME.ui_scrollbar, 0, scr_x, scr_y, scr_w, scr_h, bg_col, 1);
|
||||
draw_sprite_stretched_ext(THEME.ui_scrollbar, 0, bar_x, bar_y, bar_w, bar_h, bar_col, 1);
|
||||
if(active && point_in_rectangle(mx, my, scr_x - 2, scr_y - 2, scr_x + scr_w + 2, scr_y + scr_h + 2) || is_scrolling) {
|
||||
draw_sprite_stretched_ext(THEME.ui_scrollbar, 0, bar_x, bar_y, bar_w, bar_h, bar_hcol, 1);
|
||||
if(mouse_click(mb_left, active)) {
|
||||
if(is_vert)
|
||||
scroll_y_to = clamp((my - scr_y - scr_scale_s / 2) / (scr_s - scr_scale_s), 0, 1) * -content_h;
|
||||
else
|
||||
scroll_y_to = clamp((mx - scr_x - scr_scale_s / 2) / (scr_s - scr_scale_s), 0, 1) * -content_h;
|
||||
is_scrolling = true;
|
||||
} else
|
||||
is_scrolling = false;
|
||||
} else
|
||||
is_scrolling = false;
|
||||
scroll_ms = is_vert? my : mx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -4,7 +4,8 @@ function __init_theme() {
|
|||
directory_create(root);
|
||||
|
||||
var _l = root + "\\_theme" + string(VERSION);
|
||||
if(file_exists(_l)) return;
|
||||
|
||||
//if(file_exists(_l)) return;
|
||||
log_message("THEME", "unzipping default theme to DIRECTORY.");
|
||||
var f = file_text_open_write(_l);
|
||||
file_text_write_real(f, 0);
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "sprites",
|
||||
"path": "folders/sprites.yy",
|
||||
"name": "scritps",
|
||||
"path": "folders/main/scritps.yy",
|
||||
},
|
||||
}
|
|
@ -18,7 +18,7 @@ function textBox(_input, _onModify) constructor {
|
|||
slidable = false;
|
||||
sliding = false;
|
||||
slide_mx = 0;
|
||||
slide_sx = 0;
|
||||
slide_my = 0;
|
||||
slide_speed = 1 / 16;
|
||||
|
||||
starting_char = 1;
|
||||
|
@ -265,22 +265,34 @@ function textBox(_input, _onModify) constructor {
|
|||
|
||||
if(sliding > 0) {
|
||||
var dx = _m[0] - slide_mx;
|
||||
if(abs(dx) > 16)
|
||||
var dy = slide_my - _m[1];
|
||||
|
||||
if(sliding == 1 && (abs(dx) > 16 || abs(dy) > 16)) {
|
||||
sliding = 2;
|
||||
slide_mx = _m[0];
|
||||
slide_my = _m[1];
|
||||
}
|
||||
|
||||
if(sliding == 2) {
|
||||
var spd = dx * slide_speed;
|
||||
var spd = (abs(dx) > abs(dy)? dx : dy) * slide_speed;
|
||||
|
||||
if(keyboard_check(vk_alt))
|
||||
spd /= 10;
|
||||
if(keyboard_check(vk_control))
|
||||
spd *= 10;
|
||||
|
||||
_input_text = slide_sx + spd;
|
||||
var _ip = _input_text;
|
||||
_input_text = _input_text + spd;
|
||||
|
||||
switch(input) {
|
||||
case TEXTBOX_INPUT.number : _input_text = round(_input_text); break;
|
||||
}
|
||||
|
||||
if(_input_text != _ip) {
|
||||
slide_mx = _m[0];
|
||||
slide_my = _m[1];
|
||||
}
|
||||
|
||||
apply();
|
||||
UNDO_HOLDING = true;
|
||||
|
||||
|
@ -428,8 +440,9 @@ function textBox(_input, _onModify) constructor {
|
|||
if(hover && point_in_rectangle(_m[0], _m[1], _x, _y, _x + _w, _y + hh)) {
|
||||
if(mouse_press(mb_left, active)) {
|
||||
sliding = 1;
|
||||
|
||||
slide_mx = _m[0];
|
||||
slide_sx = toNumber(_text);
|
||||
slide_my = _m[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
4
scripts/value_snap/value_snap.gml
Normal file
4
scripts/value_snap/value_snap.gml
Normal file
|
@ -0,0 +1,4 @@
|
|||
function value_snap(val, snap) {
|
||||
if(snap == 0) return val;
|
||||
return round(val / snap) * snap;
|
||||
}
|
11
scripts/value_snap/value_snap.yy
Normal file
11
scripts/value_snap/value_snap.yy
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"resourceType": "GMScript",
|
||||
"resourceVersion": "1.0",
|
||||
"name": "value_snap",
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "value",
|
||||
"path": "folders/functions/value.yy",
|
||||
},
|
||||
}
|
Loading…
Reference in a new issue