J
Jonathan E. Styles
Guest
I am sure this is a quick and easy one for you pros, but, alas - I am new! In my game I am adding a "click-n-drag" element, but it is absolutely critical that it remains snapped to an imaginary isometric grid.
I have not programmatically created this grid, I have just placed my tiles in the room maker tool and added code to my objects. My current Draw Event for my "click-n-drag" object looks like this:
However, the sprite drags smoothly across the screen along with the mouse. Ideally I would like the "drag sprite" to move around on the screen in a grid-like pattern and allow the mouse to freely move with the sprite trailing behind in its methodical pattern.
Here is an image of what I am working with currently:
The idea is to show the user/player exactly where the item is going to be placed before they click, but it must be aligned to the "grid" to work properly. Any ideas on how I can accomplish this?
In advance, thanks for looking at this and thank you for taking any time to assist.
I have not programmatically created this grid, I have just placed my tiles in the room maker tool and added code to my objects. My current Draw Event for my "click-n-drag" object looks like this:
Code:
draw_sprite_ext(spr_Tree1_Alpha,0,mouse_x - global.offset_x,mouse_y - global.offset_y,1,1,0,c_white,.4);
if !place_snapped(16,16)
{
move_snap(16,16);
}
Here is an image of what I am working with currently:
The idea is to show the user/player exactly where the item is going to be placed before they click, but it must be aligned to the "grid" to work properly. Any ideas on how I can accomplish this?
In advance, thanks for looking at this and thank you for taking any time to assist.