#mouse_x / mouse_y sometimes not working?

7 messages · Page 1 of 1 (latest)

tame void
#

Is there any reason why mouse_x / mouse_y wouldn't be working?
For instance in this code:

        {
        draw_sprite(mycards[hand[i]].sprite, 0, cardX,cardY - 10);
        draw_sprite(spr_cardhighlight, 0, cardX,cardY - 10); } else {  draw_sprite(mycards[hand[i]].sprite, 0, cardX, cardY); }```
It won't work unless it is device_mouse_raw or gui

But this code:
```  if mouse_check_button_released(mb_left)
        {
                dragged = -1;       
                instance_create_layer(mouse_x,
                mouse_y, "Player",    mycards[hand[currenthandcard]].summon);```
Will work only if it is set to mouse_x and mouse_y.
verbal ridge
#

I think there's some things to consider with both of the mouse functions

#

device_mouse_*_to_gui applies only to the gui coordinates, something that you almost never want to use outside of the gui event.
Whereas mouse_* applies only to the room coordinates

#

This is a similar case to other mouse functions too

#

It'd be good to know which events you're calling these in

#

As well as any other surrounding code

#

As they can all have a play on here