# How Create Event OnResize??? Is Possible?

**URL:** <https://forums.unrealengine.com/t/how-create-event-onresize-is-possible/396577>\
**Category:** UI\
**Tags:** unreal-engine, question, UMG\
**Created:** [June 24, 2017, 1:32pm UTC](https://forums.unrealengine.com/t/how-create-event-onresize-is-possible/396577 "2017-06-24T13:32:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![CrashAngel](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/crashangel/32/467279_2.png) [@CrashAngel](https://forums.unrealengine.com/u/CrashAngel)\
**Post date:** [June 24, 2017, 1:32pm UTC](https://forums.unrealengine.com/t/how-create-event-onresize-is-possible/396577/1 "2017-06-24T13:32:14Z")

</div>

Hi, I developer a resource in UMG as Fluid Panel to resize Panels in Dynamic Resolution…

I have already managed to create the functions that resizes the panels to the current resolution of the viewport but I need to perform that same function when the game window is resized … same as the javascript OnResize is there any available event ???

---

<div class="post-metadata">

**Author:** ![Kokuyouseki](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kokuyouseki](https://forums.unrealengine.com/u/Kokuyouseki)\
**Post date:** [August 3, 2019, 8:31am UTC](https://forums.unrealengine.com/t/how-create-event-onresize-is-possible/396577/2 "2019-08-03T08:31:40Z")

</div>

Still nothing? This seems like something you could use on a daily basis - like with 3d ui.

---

<div class="post-metadata">

**Author:** ![s54780478](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@s54780478](https://forums.unrealengine.com/u/s54780478)\
**Post date:** [March 20, 2023, 1:41pm UTC](https://forums.unrealengine.com/t/how-create-event-onresize-is-possible/396577/3 "2023-03-20T13:41:47Z")

</div>

We Need Viewport Resized Event on BluePrint for ours Game.

---

<div class="post-metadata">

**Author:** ![BOBtheROSS](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BOBtheROSS](https://forums.unrealengine.com/u/BOBtheROSS)\
**Post date:** [January 14, 2024, 3:38pm UTC](https://forums.unrealengine.com/t/how-create-event-onresize-is-possible/396577/4 "2024-01-14T15:38:51Z")

</div>

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

 ![OnViewportResizeBind](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/e/7/ce74122aeef13ed78d8ed9112e1d586dd195eab8.png)

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 :

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

```

It’s from this post:

> [@Is there any event when the size of Viewport changed?](https://forums.unrealengine.com/t/is-there-any-event-when-the-size-of-viewport-changed/66736/7):
>
> GEngine-\>GameViewport-\>Viewport-\>ViewportResizedEvent.AddUObject(this, &MyObj::MyFunction); void MyObj::MyFunction(FViewport\* ViewPort, uint32 val) { }

* * *

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

> [@exposing FViewport::FOnViewportResized delegate in BlueprintFunctionLibrary to Blueprints](https://forums.unrealengine.com/t/exposing-fviewport-fonviewportresized-delegate-in-blueprintfunctionlibrary-to-blueprints/2436424/5):
>
> I got help from a friendly fellow on Discord and we figured out a way without the wrapper. .h DECLARE\_DYNAMIC\_DELEGATE(FOnMyViewportSizeChange); UFUNCTION(BlueprintCallable) static void BindToViewportResizeEvent(const FOnMyViewportSizeChange& ViewportSizeChanged); .cpp void UExposedFunctionsBPLibrary::BindToViewportResizeEvent(const FOnMyViewportSizeChange& ViewportSizeChanged) { FViewport::ViewportResizedEvent.AddUFunction( const\_cast\<FOnMyViewportSizeChange&\>(ViewportSizeChanged…

.h

```cpp
//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

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

```
