# Drag and Drop

**URL:** <https://forums.unrealengine.com/t/drag-and-drop/629288>\
**Category:** Blueprint\
**Tags:** unreal-engine, UE5-0, Widget, UE4, question, Blueprint\
**Created:** [August 16, 2022, 6:39am UTC](https://forums.unrealengine.com/t/drag-and-drop/629288 "2022-08-16T06:39:03Z")\
**Posts on this page:** 17\
**Page:** 2

<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:** [August 18, 2022, 8:03am UTC](https://forums.unrealengine.com/t/drag-and-drop/629288/21 "2022-08-18T08:03:30Z")

</div>

Correct me if I’m wrong but, to me, it seems that you’re just resizing an image rather than apply scale to the canvas that holds the icons:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/e/d/5edfd68d086ccf373abf23387d8431b591b544c7.png)

The idea is to have a parent container (CanvasToScaleAndMove):

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/e/8/5e89639ee47dc5a138bb5b80207404c44e7aa061.png)

This container holds everything that needs to be moved and scaled inside and you transform that container. This will, in turn, transform everything within.

---

<div class="post-metadata">

**Author:** ![RDJ3000](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RDJ3000](https://forums.unrealengine.com/u/RDJ3000)\
**Post date:** [August 18, 2022, 8:11am UTC](https://forums.unrealengine.com/t/drag-and-drop/629288/22 "2022-08-18T08:11:27Z")

</div>

I think you’re right, so i need to wrap this 2 widget in canvas and then replace it in the graph?

 ![Inkedec2598f5af86b2277ed7db69b2baf9d3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/1/7/f17a18348156375602c7d88b595de5b421dad062.jpeg)

---

<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:** [August 18, 2022, 8:11am UTC](https://forums.unrealengine.com/t/drag-and-drop/629288/23 "2022-08-18T08:11:57Z")

</div>

To follow up, with a setup like above, the most basic zoom in/out could be achieved like so:

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

You will, ofc, need more script to make a full feature - the detail are in the thread I posted.

---

<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:** [August 18, 2022, 8:14am UTC](https://forums.unrealengine.com/t/drag-and-drop/629288/24 "2022-08-18T08:14:36Z")

</div>

I _think_ you could get away with scaling the WBP\_BigMap. Unless it also contains other elements that should not be resized.

---

<div class="post-metadata">

**Author:** ![RDJ3000](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RDJ3000](https://forums.unrealengine.com/u/RDJ3000)\
**Post date:** [August 18, 2022, 8:50am UTC](https://forums.unrealengine.com/t/drag-and-drop/629288/26 "2022-08-18T08:50:58Z")

</div>

it works, but screwed up my actor position(

> **[Gyazo](https://gyazo.com/271c3e493b5c8ad1af69e9e594cc2e3b)**
>
> Easily capture screenshots, GIFs, and replays that are ready to share. Download the free app for windows and mac.

---

<div class="post-metadata">

**Author:** ![RDJ3000](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RDJ3000](https://forums.unrealengine.com/u/RDJ3000)\
**Post date:** [August 18, 2022, 9:16am UTC](https://forums.unrealengine.com/t/drag-and-drop/629288/27 "2022-08-18T09:16:03Z")

</div>

and see what happens when i move it left or right

> **[Gyazo](https://gyazo.com/a2856920bed60b04e47c2f573a5caffe)**
>
> Easily capture screenshots, GIFs, and replays that are ready to share. Download the free app for windows and mac.

---

<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:** [August 18, 2022, 9:22am UTC](https://forums.unrealengine.com/t/drag-and-drop/629288/28 "2022-08-18T09:22:43Z")

</div>

And _how_ are you moving 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:** [August 18, 2022, 9:26am UTC](https://forums.unrealengine.com/t/drag-and-drop/629288/29 "2022-08-18T09:26:39Z")

</div>

> [@RDJ3000](#):
>
> it works, but screwed up my actor position

The calculations revolve around hardcoded numbers. If you scale or move things around, you need to account for those offsets. It’s a whole bunch of math.

---

<div class="post-metadata">

**Author:** ![RDJ3000](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RDJ3000](https://forums.unrealengine.com/u/RDJ3000)\
**Post date:** [August 18, 2022, 9:53am UTC](https://forums.unrealengine.com/t/drag-and-drop/629288/30 "2022-08-18T09:53:59Z")

</div>

So i need to change this

 ![Inkedf7cd5f6ae5deddb85098483434709014](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/c/3/cc392a55f91d01d61951264d44ce86f668d0a96b.jpeg)  
or i need to create a new function with the math?

---

<div class="post-metadata">

**Author:** ![RDJ3000](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RDJ3000](https://forums.unrealengine.com/u/RDJ3000)\
**Post date:** [August 18, 2022, 10:00am UTC](https://forums.unrealengine.com/t/drag-and-drop/629288/31 "2022-08-18T10:00:26Z")

</div>

with the scrollbox

> [@Everynone](#):
>
> And _how_ are you moving it?

 ![d1071c8bd8daaef991638de9ea12bd25](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/9/7/297626bea691532a3c3c72ca0d1cdf4085901e33.jpeg)

---

<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:** [August 18, 2022, 10:17am UTC](https://forums.unrealengine.com/t/drag-and-drop/629288/32 "2022-08-18T10:17:57Z")

</div>

I am not sure which of those elements you’re planning on moving and scaling:

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/4/a/14a76702bac2024c3fd73c4656f325432fc69ed5.png)

But you’ll need to organise logically in such a way that the scroll boxes are excluded from those operations. I am _assuming_ you do not want them moved / scaled as well.

* * *

I remember trying doing something like this with nested scroll boxes but couldn’t hack it back then. It was fairly long ago, though - perhaps it can be done.

---

<div class="post-metadata">

**Author:** ![RDJ3000](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RDJ3000](https://forums.unrealengine.com/u/RDJ3000)\
**Post date:** [August 18, 2022, 10:21am UTC](https://forums.unrealengine.com/t/drag-and-drop/629288/33 "2022-08-18T10:21:23Z")

</div>

I move and scale this widget WBP\_GlobalMap and i have WBP\_Main, “WBP\_GlobalMap” is child of WBP\_Main

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/4/e/d4e94c30c3c626b538c344335a57d64ee4eb4f79.jpeg)

---

<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:** [August 18, 2022, 10:27am UTC](https://forums.unrealengine.com/t/drag-and-drop/629288/34 "2022-08-18T10:27:09Z")

</div>

Sorry, I can’t figure out what’s what. You seem to have so many things nested here…

* * *

> I move and scale this widget WBP\_GlobalMap

But this widget contains the scroll boxes? How are you expecting it to work? The elements that move it are the elements moving it? I am confused. But that would explain the wobble we saw in the anim. I was wondering what caused that, actually. Thought you implemented a fancy interpolated spring or something.

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/4/a/14a76702bac2024c3fd73c4656f325432fc69ed5.png)

Judging by the above, you should be moving and scaling `MapCanvas`. I am unsure how to set it up with scrollboxes, they have offsets that I’ve always found somewhat difficult to work with.

---

<div class="post-metadata">

**Author:** ![RDJ3000](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RDJ3000](https://forums.unrealengine.com/u/RDJ3000)\
**Post date:** [August 18, 2022, 10:38am UTC](https://forums.unrealengine.com/t/drag-and-drop/629288/35 "2022-08-18T10:38:19Z")

</div>

I’m confused as well, so now i think i need to delete these scroll boxes, and implement other methods to move it left or right. And then try to make actor spawn where i want with a math.

---

<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:** [August 18, 2022, 10:46am UTC](https://forums.unrealengine.com/t/drag-and-drop/629288/36 "2022-08-18T10:46:31Z")

</div>

If I remember correctly, the scroll boxes do not understand scaling (none of the slots do, I think) - the desired size of the widget does not change as you scale it. Even if you zoom in/out, the scroll box still sees the original size rather than the new dimensions affected by the scaling. Translation - _panning_ should work fine, though.

That’s what I recall; not necessarily how it is. I remember someone mentioning (back on AnswerHub) that they used the example and successfully incorporated scrollboxes into it.

> implement other methods to move it left or right.

In the thread I linked, all the calculations are shown. It even accounts for zooming onto the mouse cursor which I found somewhat challenging to figure out.

---

<div class="post-metadata">

**Author:** ![RDJ3000](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RDJ3000](https://forums.unrealengine.com/u/RDJ3000)\
**Post date:** [August 18, 2022, 10:54am UTC](https://forums.unrealengine.com/t/drag-and-drop/629288/37 "2022-08-18T10:54:22Z")

</div>

So i need to delete the scroll boxes so the zooming could work

---

<div class="post-metadata">

**Author:** ![RDJ3000](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RDJ3000](https://forums.unrealengine.com/u/RDJ3000)\
**Post date:** [August 18, 2022, 11:58am UTC](https://forums.unrealengine.com/t/drag-and-drop/629288/38 "2022-08-18T11:58:32Z")

</div>

Do i have another way to do it?

> **[Gyazo](https://gyazo.com/9fe8bc84b2fa9db98f649b06a96c3b5e)**
>
> Easily capture screenshots, GIFs, and replays that are ready to share. Download the free app for windows and mac.

I just need this widget disappear for a moment, when i zoom or something  
Because this method that you told, with deleting scroll boxes and all. Too complicated for my Big Brain, at least as i’m learning.  
I think you understood how my “Map” system works, so maybe you can suggest me something, so this visible bug disappears

[Previous page](https://forums.unrealengine.com/t/drag-and-drop/629288.md?page=1)
