Alexa.Ki
(Alendromeda.ki)
1
I know to print the UEnum Array
to console log output window as string.
//this will print the whole array elements in console output.
UE_LOG(LogTemp, Warning, TEXT("The Elements in Array: %s"), *UEnum::GetValueAsString(EnumArrayRef));
//Printing simple message to screen.
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("My Message"));
But how to print EnumArrayRef
to the screen?
I searched many forums, posts , google and not find the solution.
kindly guide me thank you )
c0r37py
(c0r37py::)
2
this is not as complicated as you think, if you don’t found the answer it mean nobody asked for this anywhere.
to print on the screen do it that way:
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Orange, FString::Printf(TEXT("The Elements in Array: %s"), *UEnum::GetValueAsString(Array)));
hope it helps!
cheers!
2 Likes
Alexa.Ki
(Alendromeda.ki)
3
Thank you very much helping in my studies of ue4 C++ , really appreciated
1 Like
Alexa.Ki
(Alendromeda.ki)
4
please tell me if is possible to make macro for this and how?
c0r37py
(c0r37py::)
5
in myMacros.h
#define LogEnumArray(Format, ...) if(GEngine){GEngine->AddOnScreenDebugMessage(-1, 10.0f, FColor::Yellow, FString::Printf(TEXT(Format), ##__VA_ARGS__), false);}
include the header anywhere you want to call this macro
LogEnumArray("%s", *UEnum::GetValueAsString(MyEnumArray));
hope it helps!
cheers!
2 Likes