This adds ability to draw an infinite grid at run-time (while the game is running):
This uses GridRect class previously added in #80. The grid drawing is disabled by default, so if you want to use it, you have to go into project settings and enable it manually:
The grid settings more or less match GridRect ones. Additionally, you can access the grid via code and be able to customize everything that way:
func _ready():
var grid: GridRect = Debug2D.get_grid()
If you use Camera2D or change the canvas transform, the grid's position and scale are going to be updated automatically to simulate an infinite grid. The only thing which does not work correctly is when you set Camera2D to rotating. GridRect doesn't currently support rotated grid lines, but hopefully updating origin+scale should be enough for debugging purposes.
This adds ability to draw an infinite grid at run-time (while the game is running):
This uses
GridRect
class previously added in #80. The grid drawing is disabled by default, so if you want to use it, you have to go into project settings and enable it manually:The grid settings more or less match
GridRect
ones. Additionally, you can access the grid via code and be able to customize everything that way:If you use
Camera2D
or change the canvas transform, the grid's position and scale are going to be updated automatically to simulate an infinite grid. The only thing which does not work correctly is when you setCamera2D
torotating
.GridRect
doesn't currently support rotated grid lines, but hopefully updating origin+scale should be enough for debugging purposes.