{ }Blueprint → C++

Unreal Engine 5 UMG User Interface Nodes in C++

This category maps the most common Unreal Engine 5 UMG and user interface Blueprint nodes to their exact C++ equivalents. Every entry shows the real API used in production UE5 code, including UUserWidget, CreateWidget, AddToViewport, SetInputMode, and widget event delegates. Whether you are building a HUD, a main menu, or a pause screen, these snippets cover creating and displaying widgets, controlling player input focus between game and UI, removing widgets, toggling visibility with ESlateVisibility, binding button clicks with AddDynamic, and playing UWidgetAnimation from C++.

9 nodes in this category.

Create Widget

The Create Widget Blueprint node maps to the templated CreateWidget<UUserWidget>(GetWorld(), WidgetClass) factory function in C++, which instantiates a UMG widget from a TSubclassOf<UUserWidget> class reference.View C++ equivalent →

Add to Viewport

The Add to Viewport Blueprint node corresponds to UUserWidget::AddToViewport() in C++, which renders a previously created widget on top of the game viewport.View C++ equivalent →

Set Input Mode Game Only

The Set Input Mode Game Only Blueprint node maps to constructing an FInputModeGameOnly struct and passing it to APlayerController::SetInputMode() in C++.View C++ equivalent →

Set Input Mode UI Only

The Set Input Mode UI Only Blueprint node maps to constructing an FInputModeUIOnly struct and passing it to APlayerController::SetInputMode() in C++, sending all input to the UI.View C++ equivalent →

Set Input Mode Game and UI

The Set Input Mode Game and UI Blueprint node maps to constructing an FInputModeGameAndUI struct and passing it to APlayerController::SetInputMode(), letting both the game and UI receive input.View C++ equivalent →

Remove From Parent

The Remove From Parent Blueprint node maps directly to UWidget::RemoveFromParent() in C++, which detaches a widget from the viewport or its parent panel.View C++ equivalent →

Set Widget Visibility

The Set Visibility Blueprint node maps to UWidget::SetVisibility(ESlateVisibility) in C++, where the enum value controls whether a widget is visible, collapsed, hidden, or non-interactive.View C++ equivalent →

Bind Button OnClicked

Binding a Button's OnClicked event in C++ uses PlayButton->OnClicked.AddDynamic(this, &UMyWidget::OnPlayClicked), where the handler is a UFUNCTION()-marked method bound in NativeConstruct.View C++ equivalent →

Play Widget Animation

The Play Animation Blueprint node maps to UUserWidget::PlayAnimation(MyAnim) in C++, where MyAnim is a UWidgetAnimation* exposed with the BindWidgetAnim meta specifier.View C++ equivalent →