Help with snapping

Hello, Im trying to make a program with a square cursor, which is sized 32*32, I would like for it to snap to the background grid of 32*32 Tiles, as in, if I move my mouse inside the 32*32 square, it wont move, but If I move it outside to the left, the square cursor will snap to the gridsquare to the left of the one it is currently in.

Thank You
Never Mind, Fixed it now
Topic archived. No new replies allowed.