Pixel-Composer/objects/o_dialog_graph_grid/Draw_64.gml

43 lines
1.7 KiB
Plaintext
Raw Normal View History

2022-11-03 11:44:49 +01:00
/// @description init
if !ready exit;
#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
2022-11-18 03:20:31 +01:00
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title);
2022-11-03 11:44:49 +01:00
draw_text(dialog_x + ui(24), dialog_y + ui(16), "Grid settings");
#endregion
#region draw
var yy = dialog_y + ui(64);
var ww = ui(128);
cb_enable.active = sFOCUS;
cb_enable.hover = sHOVER;
2022-11-18 03:20:31 +01:00
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text);
2022-11-03 11:44:49 +01:00
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);
yy += ui(40);
tb_size.active = sFOCUS;
tb_size.hover = sHOVER;
2022-11-18 03:20:31 +01:00
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text);
2022-11-03 11:44:49 +01:00
draw_text(dialog_x + ui(32), yy, "Grid size");
tb_size.draw(dialog_x + dialog_w - ui(24), yy, ww, TEXTBOX_HEIGHT, PANEL_GRAPH.graph_line_s, mouse_ui,, fa_right, fa_center);
yy += ui(40);
sl_opacity.active = sFOCUS;
sl_opacity.hover = sHOVER;
2022-11-18 03:20:31 +01:00
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text);
2022-11-03 11:44:49 +01:00
draw_text(dialog_x + ui(32), yy, "Grid opacity");
sl_opacity.draw(dialog_x + dialog_w - ui(24), yy, ww, TEXTBOX_HEIGHT, PANEL_GRAPH.grid_opacity, mouse_ui, ui(52), fa_right, fa_center);
2022-11-21 06:38:44 +01:00
yy += ui(40);
cl_color.active = sFOCUS;
cl_color.hover = sHOVER;
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text);
draw_text(dialog_x + ui(32), yy, "Grid Color");
cl_color.draw(dialog_x + dialog_w - ui(24) - ww, yy - TEXTBOX_HEIGHT / 2, ww, TEXTBOX_HEIGHT, PANEL_GRAPH.grid_color, mouse_ui);
2022-11-03 11:44:49 +01:00
#endregion