Just want to know if there is a way to code a UI in Unreal from Blueprint or somethng else in Unreal ?
Let’s say we are in game and the player press Quit button for quite the game. So i want the program ask the player: “Are you sure you want to quit?” with the option “Yes” and “No” buttons/options.
Don’t know if you’ve solved this yet, but I solved this using widgets. You can have a Vertical box (or Horizontal box) that gets toggled when the “Quit Game” button is pressed by changing its visibility.
Here’s the fastest implementation I found, if you don’t need to have a “good looking dialog” but just a basic confirmation prompt:
#include "Misc/MessageDialog.h"
EAppReturnType::Type Result = FMessageDialog::Open(EAppMsgType::OkCancel, FText::FromString(TEXT("Do you want to proceed?")));
if (Result == EAppReturnType::Ok) {
// User clicked "Yes"
} else {
// User clicked "No" or closed the dialog
}