Pixel-Composer/objects/o_dialog_menubox/Step_1.gml

19 lines
473 B
Plaintext
Raw Normal View History

2022-11-01 03:06:03 +01:00
/// @description
if !ready exit;
#region destroy
var hovering = false;
for( var i = 0; i < ds_list_size(children); i++ ) {
var ch = children[| i];
if(!instance_exists(ch)) continue;
var x0 = ch.dialog_x;
var x1 = ch.dialog_x + ch.dialog_w;
var y0 = ch.dialog_y;
var y1 = ch.dialog_y + ch.dialog_h;
2022-12-10 05:06:01 +01:00
hovering |= sHOVER && point_in_rectangle(mouse_mx, mouse_my, x0, y0, x1, y1);
2022-11-01 03:06:03 +01:00
}
2023-01-25 06:49:00 +01:00
if(mouse_press(mb_any, !hovering))
2022-11-01 03:06:03 +01:00
instance_destroy(self);
#endregion