Hello, I was checking out this demo as I'm struggling in creating a dimetric city building prototype.
Basically (and probably because I suck at math), I can't get zoning to snap to the grid.
I have a menu where I can choose which tile I want to build, the tile is spawned and "locked" to the mouse (set position to Mouse.X, Mouse.Y, plus an offset to center the tile).
Then when I click again the tile stops following the mouse and is "dropped" in the field.
Just for the sake of testing, I tried to make it snap to a 16x16 grid (grid and tiles were created as 64x64 - or better, 64x32 in a square image of 64x64).
But, sucking at math, the best way I came out is something like:
on "drop", set tile position to