The display position of the text in DrawDebugString is affected by the scale of the display.
Should refer to the Project() of DebugCanvas (not Canvas).
- Suggest Code
void AHUD::DrawDebugTextList() { // ... // don't draw text behind the camera if ( ((WorldTextLoc - CameraLoc) | CameraRot.Vector()) > 0.f ) { // Project with DebugCanvas // FVector ScreenLoc = Canvas->Project(WorldTextLoc); FVector ScreenLoc = DebugCanvas->Project(WorldTextLoc); TextItem.SetColor( DebugTextList[Idx].TextColor ); TextItem.Text = FText::FromString( DebugTextList[Idx].DebugText ); TextItem.Scale = FVector2D( DebugTextList[Idx].FontScale, DebugTextList[Idx].FontScale); DebugCanvas->DrawItem( TextItem, FVector2D( FMath::CeilToFloat(ScreenLoc.X), FMath::CeilToFloat(ScreenLoc.Y) ) ); } // ... }
Result:
The debug text is displayed in a location away from the Actor.
Expected:
The debug text is displayed in the Actor's location.
I am not able to find world outliner how to enable it?
Delay nodes occasionally don't fire the "Completed" output in a nativized build
An error occurred while trying to generate project files !?
Undefined sysmbol: typeinfo for AActor when cross-compile linux dedicated server on windows
How can i modify the param name in EQS node
How to achieve HLSL Multiple Render Target in Material blueprints?
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-99709 in the post.
0 |
Fix Commit | 14329579 |
---|---|
Release Commit | 14329579 |
Created | Sep 16, 2020 |
---|---|
Resolved | Sep 16, 2020 |
Updated | Apr 28, 2021 |