Pixel-Composer/objects/o_main/Draw_64.gml

79 lines
1.9 KiB
Text
Raw Normal View History

2022-01-13 11:24:03 +07:00
/// @description init
2023-06-10 13:59:45 +02:00
draw_clear(COLORS.bg);
2023-10-15 20:04:42 +07:00
#region gameframe
if(OS == os_windows && gameframe_is_minimized()) {
//gameframe_update();
exit;
} else if(OS == os_macosx) {
mac_window_step();
}
#endregion
2023-02-23 13:02:19 +07:00
2023-01-17 14:11:55 +07:00
#region widget scroll
2023-07-12 16:28:32 +02:00
if(!WIDGET_TAB_BLOCK) {
if(keyboard_check_pressed(vk_tab) && key_mod_press(SHIFT))
widget_previous();
else if(keyboard_check_pressed(vk_tab))
widget_next();
2023-01-17 14:11:55 +07:00
2023-07-12 16:28:32 +02:00
if(keyboard_check_pressed(vk_enter))
widget_trigger();
2023-01-25 12:49:00 +07:00
2023-07-12 16:28:32 +02:00
if(keyboard_check_pressed(vk_escape))
widget_clear();
}
WIDGET_TAB_BLOCK = false;
2023-01-17 14:11:55 +07:00
#endregion
#region register UI element
WIDGET_ACTIVE = [];
#endregion
2022-01-13 11:24:03 +07:00
#region panels
2023-03-11 12:40:34 +07:00
if(PANEL_MAIN == 0) resetPanel();
2023-02-14 08:51:14 +07:00
2023-02-14 13:37:13 +07:00
var surf = surface_get_target();
2023-05-08 10:50:42 +02:00
try {
2023-02-14 13:37:13 +07:00
PANEL_MAIN.draw();
2023-05-08 10:50:42 +02:00
} catch(e) {
2023-02-14 13:37:13 +07:00
while(surface_get_target() != surf)
surface_reset_target();
2023-05-03 21:42:17 +02:00
2023-02-19 08:13:19 +07:00
noti_warning(exception_print(e));
2023-02-14 13:37:13 +07:00
}
2023-02-23 13:02:19 +07:00
2023-03-11 07:40:17 +07:00
panelDraw();
2023-02-23 13:02:19 +07:00
gameframe_update();
#endregion
2023-10-15 20:04:42 +07:00
#region notes
for( var i = 0, n = array_length(PROJECT.notes); i < n; i++ )
PROJECT.notes[i].draw();
#endregion
2023-02-23 13:02:19 +07:00
#region window
var pd = gameframe_resize_padding;
if(mouse_mx > 0 && mouse_mx < pd && mouse_my > 0 && mouse_my < WIN_H)
CURSOR = cr_size_we;
if(mouse_mx > WIN_W - pd && mouse_mx < WIN_W && mouse_my > 0 && mouse_my < WIN_H)
CURSOR = cr_size_we;
if(mouse_mx > 0 && mouse_mx < WIN_W && mouse_my > 0 && mouse_my < pd)
CURSOR = cr_size_ns;
if(mouse_mx > 0 && mouse_mx < WIN_W && mouse_my > WIN_H - pd && mouse_my < WIN_H)
CURSOR = cr_size_ns;
if(mouse_mx > 0 && mouse_mx < pd && mouse_my > 0 && mouse_my < pd)
CURSOR = cr_size_nwse;
if(mouse_mx > WIN_W - pd && mouse_mx < WIN_W && mouse_my > WIN_H - pd && mouse_my < WIN_H)
CURSOR = cr_size_nwse;
if(mouse_mx > 0 && mouse_mx < pd && mouse_my > WIN_H - pd && mouse_my < WIN_H)
CURSOR = cr_size_nesw;
if(mouse_mx > WIN_W - pd && mouse_mx < WIN_W && mouse_my > 0 && mouse_my < pd)
CURSOR = cr_size_nesw;
2022-11-14 09:16:15 +07:00
#endregion