# 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:** 3

<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 22, 2024, 7:33pm UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/43 "2024-04-22T19:33:47Z")

</div>

Thanks. But how do you scale the parent canvas without scaling the child panning canvas as well? I cannot make the parent canvas smaller than the panning canvas. They both scale relative to each other.

---

<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 22, 2024, 8:12pm UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/44 "2024-04-22T20:12:19Z")

</div>

> [@AllGamesSuck](#):
>
> how do you scale the parent canvas

The parent canvas is not scaled. The operations affect the Inner Canvas only. You have a project sample - take it apart.

---

<div class="post-metadata">

**Author:** ![ExopackVFX](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ExopackVFX](https://forums.unrealengine.com/u/ExopackVFX)\
**Post date:** [May 29, 2024, 2:58pm UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/46 "2024-05-29T14:58:44Z")

</div>

This solution works great by itself, but it seems to break when i attempt to implement it into my 3rd person character project.

I have a main HUD that includes several canvas objects i call routinely for character editing, wardrobe and other functions, so i created a new canvas inside it and attempted to replicate your setup, but i can’t seem to be able to pan or zoom my 4096x4096 PNG image.

Is there anything i need to consider when recreating this system in a 3rd person project? I’m currently on v5.3, and downloaded your latest project files.

Thanks and keep up the good work!

---

<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:** [May 29, 2024, 4:26pm UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/47 "2024-05-29T16:26:03Z")

</div>

> [@ExopackVFX](#):
>
> Is there anything i need to consider when recreating this system in a 3rd person project?

No, not really. Place breakpoints and step through the script - see where it fails. Perhaps it’s a default value of a variable that is not adjusted. There’s a full project attached, too in case there are some bits you may want to have a closer look at.

---

<div class="post-metadata">

**Author:** ![ExopackVFX](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ExopackVFX](https://forums.unrealengine.com/u/ExopackVFX)\
**Post date:** [May 29, 2024, 11:54pm UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/48 "2024-05-29T23:54:48Z")

</div>

Thanks! I’ll re-check my setup, hopefully i’ll find out what’s going on! 🙂

---

<div class="post-metadata">

**Author:** ![SixArmed](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SixArmed](https://forums.unrealengine.com/u/SixArmed)\
**Post date:** [October 15, 2024, 7:13am UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/49 "2024-10-15T07:13:13Z")

</div>

Hi , I’m using your Map template in my project and now I want to spawn and place a marker in map in mouse click position translated to world.  
Currently I have setup an actor class that already has an Icon to it to display in widget now only problem I have is to accurately spawn that actor in world where mouse is clicked.

 ![image_2024_10_15T06_59_05_099Z](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/9/9/2999404f2393b31b603216929d130fe0012f69db.jpeg)  
[2024-10-15 12-14-09.mkv](https://forums.unrealengine.com/uploads/short-url/oCujFSYpwBXhuQVPrvt8e7rZCft.mkv) (3.7 MB)

---

<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 15, 2024, 7:31am UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/50 "2024-10-15T07:31:16Z")

</div>

Find where you click in the widget, translate it to world coords using the `MapRange` node.

---

<div class="post-metadata">

**Author:** ![SixArmed](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SixArmed](https://forums.unrealengine.com/u/SixArmed)\
**Post date:** [October 15, 2024, 8:07am UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/51 "2024-10-15T08:07:24Z")

</div>

![Screenshot 2024-10-15 130621](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/c/5/fc5bb3e2e5d980519dfc0d9b8a2e5bdff64bca78.jpeg)  
How do I calculate out range A and B for MapRange Node?

---

<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 15, 2024, 8:11am UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/52 "2024-10-15T08:11:01Z")

</div>

The -12360 for the x on the right which should not be negative.

* * *

Not sure if relevant but in UE x is forward so this is rotated by 90? May be intentional.

---

<div class="post-metadata">

**Author:** ![SixArmed](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SixArmed](https://forums.unrealengine.com/u/SixArmed)\
**Post date:** [October 15, 2024, 8:29am UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/53 "2024-10-15T08:29:42Z")

</div>

![Screenshot 2024-10-15 132757](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/e/3/6e3b19359debe509633be50d7ad0195a42da63cb.png)  
Apologies the x values on left and right is 0. These are actual map dimensions where origin is not centered. That’s why I’m confused in calculations.

---

<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 15, 2024, 9:12am UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/54 "2024-10-15T09:12:35Z")

</div>

See if this helps:

> [@How can I manipulate world location through a minimap widget?](https://forums.unrealengine.com/t/how-can-i-manipulate-world-location-through-a-minimap-widget/469190/2):
>
> You can detect clicking on the world map by putting a clear widget button on top of it, and then detecting the cursor location on click. (remember to zero out the alpha on all the button images Normal, Highlight, Pressed, etc.) Then to drag you’ll need to use the Drag and Drop system built-in to Unreal. It has parameters to clip your object within the bounds of the map, drag the object around responsively, and then detect when it is dropped. There is a problem you’ll need to work around to have …

You’d use `onMouseButtonDown`, ofc. Note how mouse X translates into world Y.

---

<div class="post-metadata">

**Author:** ![SixArmed](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SixArmed](https://forums.unrealengine.com/u/SixArmed)\
**Post date:** [October 16, 2024, 4:59am UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/55 "2024-10-16T04:59:57Z")

</div>

[2024-10-16 09-55-27.mkv](https://forums.unrealengine.com/uploads/short-url/k2IuCMphAFLb9QRTwFXD49fjKdZ.mkv) (4.3 MB)  
Could you please look into this video I’ve done the steps you told now one more thing.  
How to take pan and zoom in account while placing a marker because the marker position is not accurate when placed while zoomed in or pan left/right?

---

<div class="post-metadata">

**Author:** ![Quantum\_GO](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Quantum\_GO](https://forums.unrealengine.com/u/Quantum_GO)\
**Post date:** [November 5, 2024, 2:52pm UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/56 "2024-11-05T14:52:14Z")

</div>

I’ve been trying to implement in particular the zooming into my map, it seems to work fine as long as the inner canvas panel is in the center, but as soon as I move this inner canvas, the zooming seems way off. I have exactly the zooming from your example project adapted into mine, so I am a bit confused as to why it does not work as expected, do you by any chance have any idea as to why this could be?

---

<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 5, 2024, 2:58pm UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/57 "2024-11-05T14:58:57Z")

</div>

I’d rather see the relevant script than guess, tbh. We could be here all day, there’s no telling what was _adapted_ and what data feeds into what. Post both functions and explain the details of how your version works.

* * *

If you’re counting on me remembering how mine works, count again 😇 It’s going to be one of those to blame:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/a/7/ea7e1771d642ec1e6d9ad1a2f82cc1e64f31e69e.jpeg)

---

<div class="post-metadata">

**Author:** ![Quantum\_GO](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Quantum\_GO](https://forums.unrealengine.com/u/Quantum_GO)\
**Post date:** [November 5, 2024, 3:08pm UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/58 "2024-11-05T15:08:20Z")

</div>

It is pretty much an exact copy of what you have minus the clamping (for now at least)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/6/b/a6b34d6d952b0dfb34b01df4d1b7dc67785a3ce1.png)  
For moving the map I am simply moving the inner canvas (Map texture container) based on the position of the mouse compared to mouse position when I started dragging the map.  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/4/f/94f71361e971193eb21c96b8e661ce5ee9f7bbcb.png)  
The widget itself is constructed like this, with everything besides the Map Contrainer (outer canvas) being set to not hit-testable  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/c/2/cc2f9995b48ee98c24d34d8293aa4e519826dd33.png)

One more note, I am generating the widgets inside of the Map Texture Container at runtime, I did set that container to not hit testable for self & all children.

---

<div class="post-metadata">

**Author:** ![TomHank](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tomhank/32/615012_2.png) [@TomHank](https://forums.unrealengine.com/u/TomHank)\
**Post date:** [November 16, 2024, 3:34am UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/59 "2024-11-16T03:34:16Z")

</div>

Hello,I Need your Help!!!

> [@How to solve the original size problem of UMG minimap？](https://forums.unrealengine.com/t/how-to-solve-the-original-size-problem-of-umg-minimap/2005056):
>
> I have a UMG small map widget, similar to the map in Grand Theft Auto V or Red Dead Redemption 2. A map image that can be dragged and scaled in the canvas. it has a problem now, because its principle is that a large-sized image is placed in the canvas: errors will occur in the case of original size and layout. I want the image to default to the original size and be scalable. The layout will cause errors. For example, when I use the original size, the anchor point can only be in the upper left c…

---

<div class="post-metadata">

**Author:** ![Zarrar2802](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zarrar2802/32/710746_2.png) [@Zarrar2802](https://forums.unrealengine.com/u/Zarrar2802)\
**Post date:** [January 29, 2025, 9:20pm UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/60 "2025-01-29T21:20:27Z")

</div>

@Everynone Would you happen to know how I can keep the border at a fixed size inside a vertical box? My border stretches with the inner canvas

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/2/c/c2ccef88f12ff199ca17bba96daa4d32f04be377.png)

I’m creating a sort of Map Maker, so trying to re-create the World Composition window with a grid panel

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/f/c/bfc83abdad82fd00398f532f222026b4d95b1ba3.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:** [January 29, 2025, 9:46pm UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/61 "2025-01-29T21:46:31Z")

</div>

> [@Zarrar2802](#):
>
> My border stretches with the inner canvas

Not sure I follow, there’s nothing inside the inner canvas.

---

<div class="post-metadata">

**Author:** ![Zarrar2802](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zarrar2802/32/710746_2.png) [@Zarrar2802](https://forums.unrealengine.com/u/Zarrar2802)\
**Post date:** [January 29, 2025, 10:45pm UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/62 "2025-01-29T22:45:07Z")

</div>

I increased the Inner Canvas scale beyond the border’s scale. All of this is inside a Vertical Box so I can’t directly modify the border’s scale. I think I’m missing something here. Your solution sets the border desired size through the level BP. Would you happen to know how I can do that from inside the WBP itself?

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/b/d/1bd41e583f7c77d12e7d59d4565f611e460a89ee.png)

---

<div class="post-metadata">

**Author:** ![Zarrar2802](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zarrar2802/32/710746_2.png) [@Zarrar2802](https://forums.unrealengine.com/u/Zarrar2802)\
**Post date:** [January 30, 2025, 5:25am UTC](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/63 "2025-01-30T05:25:33Z")

</div>

I coped the exact code from the mouse wheel function into my project. It’s built on 5.3 however. The zoom seems to be zooming out infinitely.

could you please have a look?

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/d/3/ad333a24e62bf24fc9e674afa3d29a912ad4ca5e.png)

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

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