Hello,
I am doing an UMG in C++ for my loading screen. I am doing it with slate.
In my loading screen, I have a TextBlock, that will show tips. So, I get a random tips and put it in a string and set the text in the UMG using this string.
And then I will display it in the TextBlock.
FString ChoosenTips;
//I disable the rand for the moment, I always take the first tips and store it in my variable
ChoosenTips = AllTipsLine[1];
//I display the variable in the LOG and everything is ok, it is well stored.
UE_LOG(LogTemp, Warning, TEXT("tips: %s"), *ChoosenTips);
Here is how I set up the text widget inside my vertical box :
+ SVerticalBox::Slot()
.VAlign(VAlign_Center)
.HAlign(HAlign_Center)
.AutoHeight()
[
SNew(STextBlock)
.Text(FText::FromString(ChoosenTips))
.Justification(ETextJustify::Center)
.WrapTextAt(1200)
]
I have no issue when compiling etc. But when pressing play I see the text block empty. There is no text.
Before testing this, I tried my widget by writing something constant instead of ChoosenTips
.Text(FText::FromString(TEXT("Hello")))
And it was working well…
I am quite lost. I am not using C++ for a long time, and I am using slate since yesterday. I read a lot of things on the internet but unfortunately it is not so easy to find good information on slate.
thank you for your help and your time !
All the best