How Create Event OnResize??? Is Possible?

Get Game User Settings → Bind Event To On Game User Settings UI Needs Update

This doesn’t work with Editor Viewport size changes only when using Standalone Game or actually building the project

Maybe this works with editor viewport size changes :

GEngine->GameViewport->Viewport->ViewportResizedEvent.AddUObject(this, &MyObj::MyFunction);
void MyObj::MyFunction(FViewport* ViewPort, uint32 val)
{
}

It’s from this post:


Edit 10.04.2025
I posted c++ code for a function in a BlueuprintFunctionLibrary Plugin that lets you bind a custom event to the FViewport::ViewportResizedEvent

.h

//the delegate you will bind to in Blueprints
DECLARE_DYNAMIC_DELEGATE(FOnMyViewportSizeChange);
//the function you will call to bind
UFUNCTION(BlueprintCallable)
static void BindToViewportResizeEvent(const FOnMyViewportSizeChange& ViewportSizeChanged);

.cpp

void UExposedFunctionsBPLibrary::BindToViewportResizeEvent(const FOnMyViewportSizeChange& ViewportSizeChanged)
{
   FViewport::ViewportResizedEvent.AddUFunction(
       const_cast<FOnMyViewportSizeChange&>(ViewportSizeChanged).GetUObjectRef().Get(), 
       const_cast<FOnMyViewportSizeChange&>(ViewportSizeChanged).GetFunctionName());
}
1 Like