Does anyone know, why the Unreal Engine doesn’t have Draw Debug functions for screen space?
There is the draw debug circle, capsule, box, line, and many other functions/events. But they’re all drawing these shapes in the 3D space. Why isn’t there something similar for 2D screen space? Where you enter pixel coordinates as input, and the shape gets drawn at that location.
You can use the AHUD and UCanvas functions (DrawLine, DrawRect) to draw shapes in screen space. It’s not the same as using the Draw Debug functions, but it works for most tasks.
Yes, but you only have the Draw Line and Draw Rect, there is no draw circle or ellipse. You don’t have much control over it, and you can only use it within the HUD blueprint, as far as I’m aware. It’s not possible to call such functions inside your actors.
There are also DrawDebugCanvas2DCircle, DrawDebugCanvas2DBox etc. Check DrawDebugHelpers.h
And there are many ways to use UCanvas: AHUD::OnHUDPostRender delegate, UDebugDrawService, AActor::PostRenderFor.
Hey, sorry for the late response. But yes, this works, if I use a custom hud class derived from AHUD there is a Canvas variable that can be used.
But I still don’t understand why the Unreal Engine doesn’t have more flexible draw debug functions for screen space. DrawDebugCanvas2DCircle works great, but If you, let’s say want to draw an ellipse, you can’t, while In the regular DrawDebugCircle (3D), when defining axes, you can multiply one axis with some number and get an ellipse.