Hello again. I've been trying to get mouse controls to work. I managed to get the mouse buttons working no problem, but I'm having a fair bit of trouble getting the menu to figure out which menuvalue_x and y the mouse should be on. I tried the code above, and it only seemed to partially work. On the main menu it only every selects New Game. On the player name select it goes to 'M' immediately, then if you click it selects all the letters from A-L.
I also tried a different system where I defined some variables and used them to figure out the menuvalue_x and menuvalue_y. The variables I used:
var mouse_y_gui = device_mouse_y_to_gui(0); var mouse_x_gui = device_mouse_x_to_gui(0); var array_l = array_length(ggui_frame_l) -1; var array_w = array_length(ggui_frame_w) -1; var array_t = array_length(ggui_frame_t) -1; var array_h = array_length(ggui_frame_h) -1; var menu_width = ggui_frame_l[array_l] + ggui_frame_w[array_w]; var menu_height = ggui_frame_t[array_t] + ggui_frame_h[array_h]; var menu_x = ggui_frame_l[0]; var menu_y = ggui_frame_t[0];
to try and get this code to work:
if((mouse_x_gui > menu_x && mouse_x_gui < menu_x + menu_width) && (mouse_y_gui > menu_y && mouse_y_gui < menu_y + menu_height)) { menuvalue_x = floor(mouse_x_gui - menu_x/(menu_width/menu_w)); menuvalue_y = floor(mouse_x_gui - menu_x/(menu_width/menu_w)); }
I'm not quite sure what I missed, but it would be great to get mouse controls working, and any help would be greatly appreciated.