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 templatedCreateWidget<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 toUUserWidget::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 anFInputModeGameOnly 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 anFInputModeUIOnly 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 anFInputModeGameAndUI 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 toUWidget::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 toUWidget::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++ usesPlayButton->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 toUUserWidget::PlayAnimation(MyAnim) in C++, where MyAnim is a UWidgetAnimation* exposed with the BindWidgetAnim meta specifier.View C++ equivalent →