# How to scale/zoom a widget with blueprints?

**URL:** <https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983>\
**Category:** UI\
**Tags:** unreal-engine, Widget, UE4, question, Blueprint\
**Created:** [August 5, 2018, 5:25am UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983 "2018-08-05T05:25:44Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![TheArchitect](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheArchitect](https://forums.unrealengine.com/u/TheArchitect)\
**Post date:** [June 29, 2022, 7:13am UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/21 "2022-06-29T07:13:12Z")

</div>

Sorry to necro this old post. I’m trying to adapt your setup @Everynone for a similar use, but for the life of me can’t figure out the ClampSides function. Is there an ELI5 on how it works/prevents the image from panning/zooming out too much? It only works with the exact image from the MapZoom project.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [June 29, 2022, 7:43am UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/22 "2022-06-29T07:43:42Z")

</div>

Looks like it’s based on the actual image size, nothing seems to be hardcoded there, that was the whole point. Had I known this would get popular, I’d have made it better / clearer.

I’ll have a look and try to decipher what makes it tick because I honestly do not remember 😑 Probably not today, tomorrow.

---

<div class="post-metadata">

**Author:** ![TheArchitect](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheArchitect](https://forums.unrealengine.com/u/TheArchitect)\
**Post date:** [June 29, 2022, 9:37am UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/23 "2022-06-29T09:37:27Z")

</div>

Would really appreciate it. Thanks a lot for looking into it.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [June 29, 2022, 10:50am UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/24 "2022-06-29T10:50:22Z")

</div>

~~Hiya, could you clarify what is not working because when I use another image it seems to work OK → there’s a chance I can’t see it with this image.~~

One of the post here goes into more details:

> [@How to scale/zoom a widget with blueprints?](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/14):
>
> Perhaps I should’ve included a general overview of how it’s supposed to work so it’s easier to iron out / refactor the bits that are far from perfect. the zooming is based on the number of steps controlled by the mouse wheel Current Zoom Step / Min Zoom / Max Zoom control the zooming process Min of -3 and Max of +3 would produce 5 steps: [-2,-1,0,1,2] Min of -2 and Max of +8 would allow you to zoom out once but zoom in a lot! the Zoom Factor is the magnitude of a step where 0.4 = 60% or 0.9 =…

Perhaps that helps?

* * *

Alright, I used a proper control image and yeah, things are far from perfect if you do not set the size correctly. Can you just confirm that these values are matching on your end:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/7/a/f7a617b64a45bab39860afaa0fe7186bb7bb7854.png)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [October 24, 2022, 9:13am UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/25 "2022-10-24T09:13:51Z")

</div>

By somewhat popular demand, I’ve updated this to support adding points of interest:

> **[UE4\_MapZoom\_v2\_427.zip](https://drive.google.com/file/d/13oheFvsnDMTsVraTzG_tWTfgn12hL9L9/view?usp=sharing)**
>
> Google Drive file.

- re-jiggled the hierarchy by adding an inner canvas with auto size; we now shift that canvas instead of the image, which also moves and scales all elements attached to it

---

<div class="post-metadata">

**Author:** ![ITSaMeDIMA](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ITSaMeDIMA](https://forums.unrealengine.com/u/ITSaMeDIMA)\
**Post date:** [December 3, 2022, 12:07am UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/27 "2022-12-03T00:07:54Z")

</div>

Hi, if you don’t mind, could you explain how you make a point of interest to stay in the position of where it’s set on the map(the image) itself and move along with it? I’ve been trying to follow your method but instead of a point of interest, I want simple buttons to stay in position like it’s shown here. Currently, mine only remains in the same position of the viewport regardless of the map itself moving. Thank you very much, you’ve been a lifesaver so far.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [December 3, 2022, 6:24am UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/28 "2022-12-03T06:24:18Z")

</div>

It’s explained in the bullet point above. Also, you can download the project and see for yourself.

---

<div class="post-metadata">

**Author:** ![TheGreatShampoo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheGreatShampoo](https://forums.unrealengine.com/u/TheGreatShampoo)\
**Post date:** [April 25, 2023, 9:42pm UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/29 "2023-04-25T21:42:26Z")

</div>

i dont know how the ability to scroll pan/zoom functionality is connected to user input. But I guess those hotkeys are setup somewhere in your script

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [April 26, 2023, 4:34am UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/30 "2023-04-26T04:34:01Z")

</div>

Afair, it’s all controlled with a mouse. The overrides are in the widgets.

Also, browse that thread, there are somewhat detailed explanations regarding how things work:

> [@How to scale/zoom a widget with blueprints?](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/11):
>
> The widget itself: And the zooming onto the cursor: Seems to work OK for what it is, but there might be some kinks. [[Image from Gyazo]](https://gyazo.com/d28df9cb3ba0268124ba308e4540113f)

---

<div class="post-metadata">

**Author:** ![Rolling7Graphics](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Rolling7Graphics](https://forums.unrealengine.com/u/Rolling7Graphics)\
**Post date:** [September 24, 2023, 11:44pm UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/31 "2023-09-24T23:44:32Z")

</div>

You’re a legend. Thank you.

---

<div class="post-metadata">

**Author:** ![ganzg](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ganzg/32/579912_2.png) [@ganzg](https://forums.unrealengine.com/u/ganzg)\
**Post date:** [October 11, 2023, 1:41am UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/32 "2023-10-11T01:41:21Z")

</div>

@Everynone I’m having trouble creating an event to set the zoom level + the translation to move the map to a specific location. I have it mostly working but I find that my zoom levels get wonky afterwards (can’t zoom out as far but instead can zoom in much closer), guessing the zoom scale gets off somehow. Any ideas on how to achieve this? Thanks!

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [October 11, 2023, 5:51am UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/33 "2023-10-11T05:51:01Z")

</div>

Did you use the script in the template or did you replicate it? It’s impossible to tell what goes wrong without details. `Wonky` does not cut it.

How much one can zoom out / in is controlled with variables. Ensure you read up on how it’s set up, the info is in the thread.

---

<div class="post-metadata">

**Author:** ![BarakXYZ](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/barakxyz/32/875947_2.png) [@BarakXYZ](https://forums.unrealengine.com/u/BarakXYZ)\
**Post date:** [November 13, 2023, 3:38pm UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/34 "2023-11-13T15:38:57Z")

</div>

@Everynone  
Hey!  
Firstly, this is so amazing and appreciated. I’m really speechless from all this thread.  
Thank you so much for all the work and explanations!!

Secondly, I wanted to ask you about making the scroll work with infinite zoom-out.  
Right now it seems like I can zoom in forever in an expected manner (with settings the variable ‘Max Zoom’ to 100)  
But once I’m zooming out (with settings the variable for ‘Min Zoom’ to lets say -100), once the image isn’t covering the canvas, it behaves in a pretty strange manner, putting the image in the bottom corner and ignoring the mouse position in relationship to the image and content of the canvas while zooming out.

I’ve tried to play with it and can’t seem to understand why it happens.

Anyway, thank you so much for your time!!  
I hope you’ll have some directions on how I can implement an infinite zoom-out mechanic.

P.S - A reference to what I’m aiming for is similar to how PureRef works

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/e/8/be8eac62a4250fb33ef94effba9fc962cdc1f71b.jpeg "PureRef: Learn the Basics") ](https://www.youtube.com/watch?v=q8mfYuzq0yk&t=277s)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [November 13, 2023, 4:04pm UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/36 "2023-11-13T16:04:40Z")

</div>

Get rid of:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/4/1/84137111d1bd974bf580d0fe5d8a99e2786e8611.png)

And:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/f/c/5fc86320e4bfa15a9289b53d0a4fc3cbddc54aa9.png)

---

<div class="post-metadata">

**Author:** ![BarakXYZ](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/barakxyz/32/875947_2.png) [@BarakXYZ](https://forums.unrealengine.com/u/BarakXYZ)\
**Post date:** [November 13, 2023, 4:10pm UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/37 "2023-11-13T16:10:48Z")

</div>

@Everynone  
Are you aware of how godly you are?  
I really hope you do haha

Thank you so so much master

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [November 13, 2023, 4:11pm UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/38 "2023-11-13T16:11:37Z")

</div>

Do tell how it goes - placing stuff outside of the canvas in the editor is really annoying, unless you can punch in the values by hand, of course.

> an infinite zoom-out

Also, knowing UMG, this may not be a thing - it sure has its limits!

---

<div class="post-metadata">

**Author:** ![BarakXYZ](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/barakxyz/32/875947_2.png) [@BarakXYZ](https://forums.unrealengine.com/u/BarakXYZ)\
**Post date:** [November 13, 2023, 4:16pm UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/39 "2023-11-13T16:16:56Z")

</div>

Sure thing!  
I know who to reach for smart advice now haha

I’ve been playing with Scalable and Moveable windows in the last few weeks now; trying to project Render Targets and MetaHumans within in interesting ways

Your demo project really was an amazing savior as I’ve been struggling with that infinite scaling thingy all day haha

---

<div class="post-metadata">

**Author:** ![NickFinalBit](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NickFinalBit](https://forums.unrealengine.com/u/NickFinalBit)\
**Post date:** [February 23, 2024, 8:27pm UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/40 "2024-02-23T20:27:01Z")

</div>

Hey, sorry to bump such an old post but I was wondering how hard would it be to add a “map UI position to world location” function to your system. I’ve been trying to implement a map system, I’ve managed to convert world location to map location and set the translation of a size box inside the innercanvas to match the player location, but I can’t seem to get the position of the mouse click on the map image to translate it to world position, especially when using the zoom in. Any ideas?

Nvm, I’ve managed to find a solution on my own. Thanks for teaching us how to make the map system with zooming and panning!

 ![Screenshot_10](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/c/f/9cf3a90f08deca61cc58ebf614605fc9622dadcf.png)

---

<div class="post-metadata">

**Author:** ![AllGamesSuck](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AllGamesSuck](https://forums.unrealengine.com/u/AllGamesSuck)\
**Post date:** [April 17, 2024, 8:46pm UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/41 "2024-04-17T20:46:04Z")

</div>

> [@Everynone](#):
>
> set Panning Canvas to _Self Hit Test Invisible_

Hi, what do you mean by that? There is no such option for visibility.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [April 17, 2024, 9:06pm UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/42 "2024-04-17T21:06:08Z")

</div>

It was renamed at some point to:

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/4/2/6421881b64f9a62e99ffd3672c8d60d8a6cb2826.png)

[Previous page](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983.md?page=1)

[Next page](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983.md?page=3)
