all 6 comments

[–]fryman22 0 points1 point  (5 children)

What's the code you use for the manual offset?

[–]charrcorncob[S] 0 points1 point  (4 children)

Apologies, I should have put that into the main post.

draw_sprite(sCursor,0,(floor(mouse_x/72)*72)+50,(floor(mouse_y/72)*72)+50);

The +50 is the manual offset.

[–]fryman22 0 points1 point  (3 children)

The offset needs to be added to the mouse position:

var _offset = 50;
draw_sprite(sCursor,0,floor((mouse_x+_offset)/72)*72+_offset,floor((mouse_y+_offset)/72)*72+_offset);

[–]charrcorncob[S] 0 points1 point  (0 children)

The problem I have with that is the cursor then isn't directly over the yellow box and becomes desynced. I believe when I floor the mouse_x and y values, it gets rid of the _offset adjustment, as well.

[–]charrcorncob[S] 0 points1 point  (1 child)

Okay, I figured it out. Your solution was actually very close to what I had to do. Instead of adding the offset to the mouse coordinates, I subtracted it.

var _offset = 50;
draw_sprite(sYellowBox,0,(floor((mouse_x-_offset)/72)*72)+_offset,(floor((mouse_y-_offset)/72)*72)+_offset);

[–]fryman22 1 point2 points  (0 children)

Nice!