Unreal Engine/C++

[Unreal Engine 4 C++] 뷰포트에 텍스트 출력

한돌이 2020. 10. 15. 17:03

#include "Engine/Engine.h" 포함한 후

다음과 같이 사용합니다.

GEngine->AddOnScreenDebugMessage(Key, Time, Color, 출력할 문자);

 

void AddOnScreenDebugMessage
(
    uint64 Key,
    float TimeToDisplay,
    FColor DisplayColor,
    const FString & DebugMessage,
    bool bNewerOnTop,
    const FVector2D & TextScale
)

<함수 원형>

 

Key: -1일 경우 밀면서 갱신, -1이 아닐 경우 고정하여 갱신

 

TimeToDisplay: 보여지는 시간

 

DisplayColor: 텍스트 색상

 

DebugMessage: 출력할 텍스트

 

bNewerOnTop: True일 경우 위에서 아래로 출력, False일 경우 아래에서 위로 출력


Key 값이 -1일 경우
Key 값이 -1이 아닐 경우