How to scale/zoom a widget with blueprints?

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.

1 Like

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 :expressionless: Probably not today, tomorrow.

2 Likes

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

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:

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:

2 Likes

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

  • 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
13 Likes

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.

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

1 Like

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

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:

1 Like

You’re a legend. Thank you.

@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!

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.

@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

1 Like

Get rid of:

And:

1 Like

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

Thank you so so much master

1 Like

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!

1 Like

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

1 Like

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!

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

It was renamed at some point to:

image