I have a Slate widget that I create like this:
void SetUpWidget()
{
FText SlateHUDText = FText::FromString("This is the first text");
FLevelEditorModule& LevelEditor = FModuleManager::GetModuleChecked<FLevelEditorModule>(TEXT("LevelEditor"));
TSharedPtr<ILevelViewport> LViewport = LevelEditor.GetFirstActiveViewport();
TSharedRef<SWidget> NewWidget = SNew(SOverlay)
+ SOverlay::Slot()
.VAlign(VAlign_Top)
.HAlign(HAlign_Center)
[
SNew(STextBlock)
.ColorAndOpacity(FLinearColor::White)
.Font(FSlateFontInfo("Veranda", 16))
.Text(TestHUDText)
//.Text_Lambda() // HOW TO?
];
LViewport->AddOverlayWidget(NewWidget);
}
I have another function that updates a string variable on Tick. What I would like to do is BIND the string variable to the TSharedRef TextBlock, so that it updates every time the variable does. Is this done with the Text_Lambda
attribute? Or is there another way?
Thanks!