Unreal Engine Slate UI examples

Push Button

Adding this to some AActor, component etc. adds a push button to the "Details" pannel:

// .hpp
UFUNCTION(BlueprintCallable, CallInEditor)
void myFun();

// .cpp
// Callback when pushed
void AMyActor::myFun() {
    UE_LOG(LogTemp, Error, TEXT("This is a test"));
}

Progress Bar

Block access to editor's UI with a progress bar when launching a time consuming operation:

FScopedSlowTask SomeTask(List.Num(), FText::FromString(TEXT("Do stuff")));
SomeTask.MakeDialog();

for (int32 Index = 0; Index < List.Num(); ++Index)
{
	SomeTask.EnterProgressFrame();
}

Other resources

- https://docs.unrealengine.com/4.26/en-US/ProgrammingAndScripting/Slate/Widgets/
- https://ikrima.dev/ue4guide/editor-extensions/slate/useful-slate-code-samples/

- List of UPROPERTY ui and screenshots

No comments

(optional field, I won't disclose or spam but it's necessary to notify you if I respond to your comment)
All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.
Anti-spam question: