• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

SOLVED cursor_sprite not working for me anymore

flyinian

Member
I'm currently using cursor_sprite in the step event of a persistent object and nothing is drawing. cursor_sprite has a sprite assigned to it.

This was working fine for the longest time and now all of a sudden, it stopped working.

Any ideas on why this is?


Edit:

For debugging, I added this below. The line with the set coordinates shows while the line w. the mouse coordinates don't show.
GML:
draw_sprite(Spr_Cross,0,50,50);
draw_sprite(Spr_Cross,0,mouse_x,mouse_y);
Thanks.
 

jobjorgos

Member
I'm currently using cursor_sprite in the step event of a persistent object
the cursor_sprite functions needs only to be set once? why do you want to set the sprite every frame, it only needs to be set once no?
IF you want the object to be the sprite, you dont use cursor_sprite but use the draw GUI end event and set the depth of the object as negative as possible
 

flyinian

Member
the cursor_sprite functions needs only to be set once? why do you want to set the sprite every frame, it only needs to be set once no?
IF you want the object to be the sprite, you dont use cursor_sprite but use the draw GUI end event and set the depth of the object as negative as possible
Thanks for the reply.

I've decided to got with:

window_set_cursor(cr_cross);


I've decided to go this route:
IF you want the object to be the sprite, you dont use cursor_sprite but use the draw GUI end event and set the depth of the object as negative as possible
.

But, The cursor won't draw above the player's gui elements.

I've set the depth of the cursor to -16000 in the gui end event and also tried the layer_depth but, it still draws below the player's gui elements.

The cursor has its own layer and its the negative most layer.

edit: I checked the depths of the player's gui elements and the cursor. The cursor is at a more negative value than the player's gui elements.
 
Last edited:
Top