Helper class to derive from to use debug draw delegate functionalities (i.e. DrawDebugLabels) The class will take care of registering a delegate to the [UDebugDrawService](API\Runtime\Engine\Debug\UDebugDrawService) and draw all FText3d provided by the scene proxy.
Helper class to derive from to use debug draw delegate functionalities (i.e. DrawDebugLabels) The class will take care of registering a delegate to the UDebugDrawService and draw all FText3d provided by the scene proxy. This functionality only requires the derived classes to override `CreateDebugSceneProxy_.
It is also possible to add text from other sources of data from the scene proxy but that requires a few extra steps:
add a method to be able to populate the source data from the scene proxy
ex: class FMyDelegateHelper : public FDebugDrawDelegateHelper { public: void SetupFromProxy(const FMySceneProxy* InSceneProxy) { }; protected: virtual void DrawDebugLabels(UCanvas* Canvas, APlayerController*) override { }; private: TArray SomeData; };
add a property of that new helper type in the component inheriting from `UDebugDrawComponent_
override `GetDebugDrawDelegateHelper_ to return that new member as the new delegate helper to use
and then use it in `CreateDebugSceneProxy_ before returning the created proxy.
ex: class MyDebugDrawComponent : public UDebugDrawComponent { protected: virtual FDebugRenderSceneProxy* CreateDebugSceneProxy() override { FMySceneProxy* Proxy = new FMySceneProxy(this); MyDelegateHelper.SetupFromProxy(Proxy); return Proxy; }
virtual FDebugDrawDelegateHelper& GetDebugDrawDelegateHelper() override { return MyDelegateHelper; } private: FMyDelegateHelper MyDelegateHelper; }