mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2025-01-13 15:56:35 +01:00
Preview window, print node
This commit is contained in:
parent
bb2874e67e
commit
a8ad686f6c
9 changed files with 56 additions and 8 deletions
|
@ -296,6 +296,7 @@
|
||||||
{"name":"sh_polar","order":1,"path":"shaders/sh_polar/sh_polar.yy",},
|
{"name":"sh_polar","order":1,"path":"shaders/sh_polar/sh_polar.yy",},
|
||||||
{"name":"s_node_warp_mesh","order":10,"path":"sprites/s_node_warp_mesh/s_node_warp_mesh.yy",},
|
{"name":"s_node_warp_mesh","order":10,"path":"sprites/s_node_warp_mesh/s_node_warp_mesh.yy",},
|
||||||
{"name":"sh_pixel_cloud","order":13,"path":"shaders/sh_pixel_cloud/sh_pixel_cloud.yy",},
|
{"name":"sh_pixel_cloud","order":13,"path":"shaders/sh_pixel_cloud/sh_pixel_cloud.yy",},
|
||||||
|
{"name":"printer","order":2,"path":"scripts/printer/printer.yy",},
|
||||||
{"name":"sh_de_stray","order":16,"path":"shaders/sh_de_stray/sh_de_stray.yy",},
|
{"name":"sh_de_stray","order":16,"path":"shaders/sh_de_stray/sh_de_stray.yy",},
|
||||||
{"name":"sh_chromatic_aberration","order":31,"path":"shaders/sh_chromatic_aberration/sh_chromatic_aberration.yy",},
|
{"name":"sh_chromatic_aberration","order":31,"path":"shaders/sh_chromatic_aberration/sh_chromatic_aberration.yy",},
|
||||||
{"name":"fd_rectangle_create_view","order":3,"path":"scripts/fd_rectangle_create_view/fd_rectangle_create_view.yy",},
|
{"name":"fd_rectangle_create_view","order":3,"path":"scripts/fd_rectangle_create_view/fd_rectangle_create_view.yy",},
|
||||||
|
|
|
@ -1034,6 +1034,7 @@
|
||||||
{"id":{"name":"sh_polar","path":"shaders/sh_polar/sh_polar.yy",},},
|
{"id":{"name":"sh_polar","path":"shaders/sh_polar/sh_polar.yy",},},
|
||||||
{"id":{"name":"s_node_warp_mesh","path":"sprites/s_node_warp_mesh/s_node_warp_mesh.yy",},},
|
{"id":{"name":"s_node_warp_mesh","path":"sprites/s_node_warp_mesh/s_node_warp_mesh.yy",},},
|
||||||
{"id":{"name":"sh_pixel_cloud","path":"shaders/sh_pixel_cloud/sh_pixel_cloud.yy",},},
|
{"id":{"name":"sh_pixel_cloud","path":"shaders/sh_pixel_cloud/sh_pixel_cloud.yy",},},
|
||||||
|
{"id":{"name":"printer","path":"scripts/printer/printer.yy",},},
|
||||||
{"id":{"name":"node_iterate","path":"scripts/node_iterate/node_iterate.yy",},},
|
{"id":{"name":"node_iterate","path":"scripts/node_iterate/node_iterate.yy",},},
|
||||||
{"id":{"name":"sh_de_stray","path":"shaders/sh_de_stray/sh_de_stray.yy",},},
|
{"id":{"name":"sh_de_stray","path":"shaders/sh_de_stray/sh_de_stray.yy",},},
|
||||||
{"id":{"name":"sh_chromatic_aberration","path":"shaders/sh_chromatic_aberration/sh_chromatic_aberration.yy",},},
|
{"id":{"name":"sh_chromatic_aberration","path":"shaders/sh_chromatic_aberration/sh_chromatic_aberration.yy",},},
|
||||||
|
|
Binary file not shown.
|
@ -20,7 +20,7 @@ if(OS == os_windows && gameframe_is_minimized()) exit;
|
||||||
draw_tooltip_text(string_real(content));
|
draw_tooltip_text(string_real(content));
|
||||||
break;
|
break;
|
||||||
case VALUE_TYPE.boolean :
|
case VALUE_TYPE.boolean :
|
||||||
draw_tooltip_text(content? get_text("true", "True") : get_text("false", "False"));
|
draw_tooltip_text(printBool(content));
|
||||||
break;
|
break;
|
||||||
case VALUE_TYPE.curve :
|
case VALUE_TYPE.curve :
|
||||||
draw_tooltip_text("[" + get_text("tooltip_curve_object", "Curve Object") + "]");
|
draw_tooltip_text("[" + get_text("tooltip_curve_object", "Curve Object") + "]");
|
||||||
|
|
|
@ -52,7 +52,10 @@ function checkBox(_onClick) : widget() constructor {
|
||||||
} else
|
} else
|
||||||
if(mouse_press(mb_left)) deactivate();
|
if(mouse_press(mb_left)) deactivate();
|
||||||
|
|
||||||
if(_value) draw_sprite_stretched_ext(spr, 2, _dx, _dy, ss, ss, COLORS._main_accent, aa);
|
if(is_array(_value))
|
||||||
|
draw_sprite_stretched_ext(spr, 3, _dx, _dy + ss / 2 - 8, ss, 16, COLORS._main_accent, aa);
|
||||||
|
else if(_value)
|
||||||
|
draw_sprite_stretched_ext(spr, 2, _dx, _dy, ss, ss, COLORS._main_accent, aa);
|
||||||
|
|
||||||
if(WIDGET_CURRENT == self)
|
if(WIDGET_CURRENT == self)
|
||||||
draw_sprite_stretched_ext(THEME.widget_selecting, 0, _dx - ui(3), _dy - ui(3), ss + ui(6), ss + ui(6), COLORS._main_accent, 1);
|
draw_sprite_stretched_ext(THEME.widget_selecting, 0, _dx - ui(3), _dy - ui(3), ss + ui(6), ss + ui(6), COLORS._main_accent, 1);
|
||||||
|
|
|
@ -143,5 +143,6 @@
|
||||||
win.node_target = node;
|
win.node_target = node;
|
||||||
win.preview_channel = node.preview_channel;
|
win.preview_channel = node.preview_channel;
|
||||||
var dia = dialogPanelCall(win, mouse_mx, mouse_my);
|
var dia = dialogPanelCall(win, mouse_mx, mouse_my);
|
||||||
|
dia.destroy_on_click_out = false;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
|
@ -13,6 +13,7 @@ function Panel_Preview_Window() : PanelContent() constructor {
|
||||||
title_show = 0;
|
title_show = 0;
|
||||||
|
|
||||||
scale = 0;
|
scale = 0;
|
||||||
|
scale_levels = [ 1/32, 1/24, 1/16, 1/12, 1/8, 1/4, 1/3, 1/2, 2/3, 1, 1.5, 2, 3, 4, 6, 8, 12, 16, 24, 32];
|
||||||
panx = 0;
|
panx = 0;
|
||||||
pany = 0;
|
pany = 0;
|
||||||
|
|
||||||
|
@ -116,12 +117,31 @@ function Panel_Preview_Window() : PanelContent() constructor {
|
||||||
|
|
||||||
if(pHOVER) {
|
if(pHOVER) {
|
||||||
var inc = 0.5;
|
var inc = 0.5;
|
||||||
if(scale > 16) inc = 2;
|
if(scale > 64) inc = 4;
|
||||||
|
else if(scale > 16) inc = 2;
|
||||||
else if(scale > 8) inc = 1;
|
else if(scale > 8) inc = 1;
|
||||||
|
else if(scale > 2) inc = 0.5;
|
||||||
|
else if(scale > 0.25) inc = 0.25;
|
||||||
|
else inc = 0.05;
|
||||||
|
|
||||||
var s = scale;
|
var s = scale;
|
||||||
if(mouse_wheel_down()) scale = max(round(scale / inc) * inc - inc, 0.25);
|
if(mouse_wheel_down()) {
|
||||||
if(mouse_wheel_up()) scale = min(round(scale / inc) * inc + inc, 32);
|
for( var i = 0; i < array_length(scale_levels) - 1; i++ ) {
|
||||||
|
if(s > scale_levels[i] && s <= scale_levels[i + 1]) {
|
||||||
|
scale = scale_levels[i];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(mouse_wheel_up()) {
|
||||||
|
for( var i = 0; i < array_length(scale_levels) - 1; i++ ) {
|
||||||
|
if(s >= scale_levels[i] && s < scale_levels[i + 1]) {
|
||||||
|
scale = scale_levels[i + 1];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var ds = scale - s;
|
var ds = scale - s;
|
||||||
panx = panx / s * scale;
|
panx = panx / s * scale;
|
||||||
|
|
11
scripts/printer/printer.gml
Normal file
11
scripts/printer/printer.gml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
function printBool(val) {
|
||||||
|
if(!is_array(val)) return val? get_text("true", "True") : get_text("false", "False");
|
||||||
|
|
||||||
|
var ss = "[";
|
||||||
|
for( var i = 0; i < array_length(val); i++ ) {
|
||||||
|
ss += (i? ", " : "") + printBool(val[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
ss += "]";
|
||||||
|
return ss;
|
||||||
|
}
|
11
scripts/printer/printer.yy
Normal file
11
scripts/printer/printer.yy
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"resourceType": "GMScript",
|
||||||
|
"resourceVersion": "1.0",
|
||||||
|
"name": "printer",
|
||||||
|
"isCompatibility": false,
|
||||||
|
"isDnD": false,
|
||||||
|
"parent": {
|
||||||
|
"name": "debug",
|
||||||
|
"path": "folders/functions/debug.yy",
|
||||||
|
},
|
||||||
|
}
|
Loading…
Reference in a new issue