#define menu_detect //created by: ashkan sa'idi //if the arg6 is false arg5,4,3 are not important //script must put in drawing event and draw text with current font and color //if button of arg7 is down when mouse is on the menu string of arg8 will //be execute it can be name of a script or a simple function //or "" for no action //for arg7 you must use mb_left mb_right mb_middle mb_none or mb_any //the rectangle must be outline for normal uses //arg0 menu x pos //arg1 menu y pos //arg2 menu text //arg3 distance before and after menu for drawing rectangle //arg4 rectangle color //arg5 outline rectangle or not //arg6 draw rectangle or not //arg7 the mouse button that must be down for menu to be active //arg8 the string to execute if menu is active draw_text (argument0,argument1,argument2) //check selection of a menu if mouse_x > argument0 && mouse_x < (argument0 + string_width (argument2)) { if mouse_y > argument1 && mouse_y < (argument1 + string_height (argument2)) { if argument6 != 0 { draw_rectangle_color (argument0 - argument3,argument1 - argument3,argument0 + argument3 + string_width (argument2),argument1 + argument3 + string_height (argument2),argument4,argument4,argument4,argument4,argument5) } if mouse_button == argument7 { execute_string (argument8) } return argument2 } } //no menu is selected return ""