Hi, I have a custom HUD in the editor, I have had to change how I do this in 4.13, and am having problems…
I have a widget, and every tick it updates. What I want to do is update the displayed value, but it seems to be creating a new SOverlay every tick, and killing my fps. Where am i going wrong here? How can I clear the baseWidget
and rebuild it, every tick? OR, just update the value in the STextBlock?
Thanks!
FLevelEditorModule& LevelEditor = FModuleManager::GetModuleChecked<FLevelEditorModule>(TEXT("LevelEditor"));
TSharedPtr<ILevelViewport> LViewport = LevelEditor.GetFirstActiveViewport();
TSharedRef<SWidget> baseWidget = SNew(SOverlay)
+ SOverlay::Slot()
.VAlign(VAlign_Bottom)
.HAlign(HAlign_Fill)
//Colored Background
SNew(SBorder)
.Padding(FMargin(2))
// Image for BG
.BorderImage(&brushClr)
SNew(STextBlock)
.Justification(ETextJustify::Right)
.Text(RecHUDText)
.Margin(15)
.ColorAndOpacity(FLinearColor::Red)
.Font(FSlateFontInfo("Veranda", 20))
]
]
LViewport->RemoveOverlayWidget(baseWidget);
LViewport->AddOverlayWidget(baseWidget);