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.
The parent canvas is not scaled. The operations affect the Inner Canvas only. You have a project sample - take it apart.
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!
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.
Thanks! I’ll re-check my setup, hopefully i’ll find out what’s going on!
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.
2024-10-15 12-14-09.mkv (3.7 MB)
Find where you click in the widget, translate it to world coords using the MapRange
node.
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.
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.
See if this helps:
You’d use onMouseButtonDown
, ofc. Note how mouse X translates into world Y.
2024-10-16 09-55-27.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?
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?
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:
It is pretty much an exact copy of what you have minus the clamping (for now at least)
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.
The widget itself is constructed like this, with everything besides the Map Contrainer (outer canvas) being set to not hit-testable
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.
Hello,I Need your Help!!!