Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Menu cursor moviment with mouse

A topic by Marvin Argollo created Aug 20, 2022 Views: 173 Replies: 2
Viewing posts 1 to 2
(1 edit)

Hello again, Im trying to change the cursor moviment to be with the mouse, but the only way I found out is changing in each menu the ui_cursor_update parameters, is there any more efficient way to change from arrow to mouse movement or am I do it right?  

and how do I make the cursor appear when i move the mouse? is that it only appears when i press something on the keyboard

Developer(+1)

That's the correct way of doing it.
The automatic cursor adding is in obj_mis_system > Begin Step, it's not really set up for mouse so you'd have to do some work. You can detect when the mouse moves by seeing if the mouse_x or mouse_y coordinates change, but it might be better to check for mouse clicks so it won't add a cursor if your mouse moves just a small amount.

thanks, I managed to make the cursor appear on click just by changing an if statement

var _num = mis_data().max_keyboards;     
for(var i = 0; i < _num; i++){         
    if (!mis_device_port_is_connected(i, MIS_DEVICE_TYPE.keyboard)){             
        //Connect if any key is pressed             
        if (keyboard_check_pressed(vk_anykey) || mouse_check_button_released(mb_any)){                 
            mis_device_connect(MIS_DEVICE_TYPE.keyboard, i);                 
        }             
    }         
}


I admit that I think it's a lazy solution... 馃槄 maybe I'll change it if there's a problem but so far it's going well