Draw grid and check colisions with other objects for every cell

Hi. Is there a way to create a 2D grid and check whether the object in the cell? I want use it for pathfinding) Thanks)

You can always check the Bounds of your object by Bounds class.