> On clicked, store Mouse.X and Mouse.Y
> Use math to split the position with grid size so you will be able to know the grid position to place the object.
>
> Example: Mouse.X=1222 and Mouse.Y=342
> The grid size is 128x128 so
> 1222/128 = 9.54
> 342/128 = 2.67
>
> So you need to create the object on grid 9x2..
> Converting into pixels.. 1152x256
I am very late, but I tried this from what I could understand. I got this. imgur.com/7gmtUit. But, it doesn't work, and just places it far away from the mouse (on no grid).
On clicked -> Create Object At
X: (floor(Mouse.X/16))*16
Y: (floor(Mouse.Y/16))*16
Dont forget to set the sprite origin image point at Top Left