Simple debug draw in 2d for Godot 4?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By idbrii

DmitriySalnikov’s godot_debug_draw_3d is great for 3d, but is there an equivalent for 2d? Custom drawing in 2D with _draw is too cumbersome.

I want to specify a shape and some positions for debug drawing that can be disabled in production builds.

GodotDebugDraw has an api that looks promising, but it doesn’t work in Godot 4:

func _process(delta):
	var screen_centre = get_viewport().size/2
	DebugDraw2D.draw_circle(screen_centre, 25, 16, Color(1, 1, 1))
	DebugDraw2D.draw_rect_filled(screen_centre - Vector2(100, -100), Vector2(20, 10), Color(1, 1, 1))
	DebugDraw2D.draw_circle_arc(screen_centre + Vector2(100, 0), 25, 45, 135, true, 16, Color(1, 1, 1))
	DebugDraw2D.draw_arrow_vector(screen_centre + Vector2(125, 110), Vector2(-50, 0), Color(1, 1, 1), 5)

Is there something like that for Godot 4? The Asset Library currently shows zero results.

:bust_in_silhouette: Reply From: idbrii

I ended up porting GodotDebugDraw to Godot 4.