Following cursor by grid

Hi, I created an image that follows my cursor, how can I make that image move by the grid and not freely?

Hope you can answer my question, since I’m a little bit in trouble with my users for that…

Thanx