Pixel-Composer/scripts/panel_node_align/panel_node_align.gml

60 lines
2 KiB
Text
Raw Normal View History

2023-05-08 19:14:30 +02:00
function Panel_Node_Align() : PanelContent() constructor {
2023-06-04 18:28:29 +02:00
title = __txt("Align");
2023-08-06 16:00:59 +02:00
w = 160;
h = 32 + 8 * 2;
2023-05-08 19:14:30 +02:00
function drawContent(panel) {
draw_clear_alpha(COLORS.panel_bg_clear, 0);
2023-08-06 16:00:59 +02:00
var xx = 8;
var yy = 8;
2023-05-08 19:14:30 +02:00
2023-08-06 16:00:59 +02:00
/////////////////////////////
2023-05-08 19:14:30 +02:00
2024-12-16 12:03:02 +01:00
if(buttonInstant(THEME.button_hide, xx, yy, 32, 32, [mx, my], pHOVER, pFOCUS,, THEME.object_halign, 0, c_white) == 2)
node_halign(PANEL_GRAPH.nodes_selecting, fa_left);
2023-08-06 16:00:59 +02:00
xx += 34
2024-12-16 12:03:02 +01:00
if(buttonInstant(THEME.button_hide, xx, yy, 32, 32, [mx, my], pHOVER, pFOCUS,, THEME.object_halign, 1, c_white) == 2)
node_halign(PANEL_GRAPH.nodes_selecting, fa_center);
2023-08-06 16:00:59 +02:00
xx += 34
2024-12-16 12:03:02 +01:00
if(buttonInstant(THEME.button_hide, xx, yy, 32, 32, [mx, my], pHOVER, pFOCUS,, THEME.object_halign, 2, c_white) == 2)
node_halign(PANEL_GRAPH.nodes_selecting, fa_right);
2023-08-06 16:00:59 +02:00
xx += 34
xx += 2;
draw_set_color(CDEF.main_dkblack);
draw_line_width(xx, yy + 16 - 10, xx, yy + 16 + 10, 3);
xx += 6;
2023-05-08 19:14:30 +02:00
2023-08-06 16:00:59 +02:00
/////////////////////////////
2024-12-16 12:03:02 +01:00
if(buttonInstant(THEME.button_hide, xx, yy, 32, 32, [mx, my], pHOVER, pFOCUS,, THEME.object_valign, 0, c_white) == 2)
node_valign(PANEL_GRAPH.nodes_selecting, fa_top);
2023-08-06 16:00:59 +02:00
xx += 34
2024-12-16 12:03:02 +01:00
if(buttonInstant(THEME.button_hide, xx, yy, 32, 32, [mx, my], pHOVER, pFOCUS,, THEME.object_valign, 1, c_white) == 2)
node_valign(PANEL_GRAPH.nodes_selecting, fa_middle);
2023-08-06 16:00:59 +02:00
xx += 34
2024-12-16 12:03:02 +01:00
if(buttonInstant(THEME.button_hide, xx, yy, 32, 32, [mx, my], pHOVER, pFOCUS,, THEME.object_valign, 2, c_white) == 2)
node_valign(PANEL_GRAPH.nodes_selecting, fa_bottom);
2023-08-06 16:00:59 +02:00
xx += 34
xx += 2;
draw_set_color(CDEF.main_dkblack);
draw_line_width(xx, yy + 16 - 10, xx, yy + 16 + 10, 3);
xx += 6;
2023-05-08 19:14:30 +02:00
2023-08-06 16:00:59 +02:00
/////////////////////////////
2023-05-08 19:14:30 +02:00
2024-12-16 12:03:02 +01:00
if(buttonInstant(THEME.button_hide, xx, yy, 32, 32, [mx, my], pHOVER, pFOCUS,, THEME.obj_distribute_h, 0, c_white) == 2)
node_hdistribute(PANEL_GRAPH.nodes_selecting);
2023-08-06 16:00:59 +02:00
xx += 34
2024-12-16 12:03:02 +01:00
if(buttonInstant(THEME.button_hide, xx, yy, 32, 32, [mx, my], pHOVER, pFOCUS,, THEME.obj_distribute_v, 0, c_white) == 2)
node_vdistribute(PANEL_GRAPH.nodes_selecting);
2023-08-06 16:00:59 +02:00
xx += 34
2023-05-08 19:14:30 +02:00
}
}