Drag and Drop

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:

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

image

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

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

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

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

I think you could get away with scaling the WBP_BigMap. Unless it also contains other elements that should not be resized.

it works, but screwed up my actor position(

and see what happens when i move it left or right

And how are you moving it?

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.

So i need to change this


or i need to create a new function with the math?

with the scrollbox

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

image

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.

I move and scale this widget WBP_GlobalMap and i have WBP_Main, “WBP_GlobalMap” is child of WBP_Main

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

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.

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.

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.

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

Do i have another way to do it?

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