Pixel-Composer/objects/o_dialog_graph_grid/Draw_64.gml

45 lines
2.0 KiB
Plaintext
Raw Normal View History

2022-11-03 11:44:49 +01:00
/// @description init
if !ready exit;
2023-08-01 19:21:51 +02:00
if(PANEL_GRAPH.project == noone || !PANEL_GRAPH.project.active)
instance_destroy();
2022-11-03 11:44:49 +01:00
#region base UI
2022-11-18 03:20:31 +01:00
draw_sprite_stretched(THEME.dialog_bg, 0, dialog_x, dialog_y, dialog_w, dialog_h);
2022-11-03 11:44:49 +01:00
if(sFOCUS)
2022-11-18 03:20:31 +01:00
draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1);
2022-11-03 11:44:49 +01:00
2023-06-10 13:59:45 +02:00
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
2023-06-05 18:27:53 +02:00
draw_text(dialog_x + ui(24), dialog_y + ui(16), __txtx("grid_title", "Grid settings"));
2022-11-03 11:44:49 +01:00
#endregion
#region draw
var yy = dialog_y + ui(64);
var ww = ui(128);
2023-06-21 20:36:53 +02:00
cb_enable.setFocusHover(sFOCUS, sHOVER);
2023-01-25 06:49:00 +01:00
cb_enable.register();
2022-11-18 03:20:31 +01:00
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text);
2023-06-05 18:27:53 +02:00
draw_text(dialog_x + ui(32), yy, __txtx("grid_snap", "Snap to grid"));
2023-08-01 19:21:51 +02:00
cb_enable.draw(dialog_x + dialog_w - ui(24) - ww / 2, yy, PANEL_GRAPH.project.graphGrid.snap, mouse_ui,, fa_center, fa_center);
2022-11-03 11:44:49 +01:00
yy += ui(40);
2023-06-21 20:36:53 +02:00
tb_size.setFocusHover(sFOCUS, sHOVER);
2023-01-25 06:49:00 +01:00
tb_size.register();
2022-11-18 03:20:31 +01:00
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text);
2023-06-05 18:27:53 +02:00
draw_text(dialog_x + ui(32), yy, __txtx("grid_size", "Grid size"));
2023-08-01 19:21:51 +02:00
tb_size.draw(dialog_x + dialog_w - ui(24), yy, ww, TEXTBOX_HEIGHT, PANEL_GRAPH.project.graphGrid.size, mouse_ui,, fa_right, fa_center);
2022-11-03 11:44:49 +01:00
yy += ui(40);
2023-06-21 20:36:53 +02:00
sl_opacity.setFocusHover(sFOCUS, sHOVER);
2023-01-25 06:49:00 +01:00
sl_opacity.register();
2022-11-18 03:20:31 +01:00
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text);
2023-08-01 19:21:51 +02:00
draw_text(dialog_x + ui(32), yy, __txtx("project.graphGrid.opacity", "Grid opacity"));
sl_opacity.draw(dialog_x + dialog_w - ui(24), yy, ww, TEXTBOX_HEIGHT, PANEL_GRAPH.project.graphGrid.opacity, mouse_ui, ui(52), fa_right, fa_center);
2022-11-21 06:38:44 +01:00
yy += ui(40);
2023-06-21 20:36:53 +02:00
cl_color.setFocusHover(sFOCUS, sHOVER);
2023-01-25 06:49:00 +01:00
cl_color.register();
2022-11-21 06:38:44 +01:00
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text);
2023-08-01 19:21:51 +02:00
draw_text(dialog_x + ui(32), yy, __txtx("project.graphGrid.color", "Grid color"));
cl_color.draw(dialog_x + dialog_w - ui(24) - ww, yy - TEXTBOX_HEIGHT / 2, ww, TEXTBOX_HEIGHT, PANEL_GRAPH.project.graphGrid.color, mouse_ui);
2022-11-03 11:44:49 +01:00
#endregion