Say I have a map of the level as an image widget. There’s multiple events subtly hidden in the level and the player has to mark those events with a marker-widget interactively on the map when they find one in the level. (This all happens in an UI Overlay)
The event spots on the map are also widgets, which I anchored to the center of the screen / map, since otherwise they’d move relative to their initial placement on the map if I were to rescale the viewport (which is mainly the problem here, since I need the UI to work on any desktop screen resolution).
The mark-widget is anchored to the top-left of the screen, since it follows the cursor’s screenspace position until clicked. Anchoring the mark to the center of the screen too would render it useless, since it would constantly be offset to the mouse, unable to ever be clicked and placed.
I’ve tried anchoring the mark to the center and instead offset it’s position by half the viewport size to be under the cursor, which works on my machine ( ) if I start the project in fullscreen, but immedeatly breaks apart, once I resize the window.
I’ve also tried using the “Local to Viewport” and “Local to Absolute” nodes, coming off “Get Cached Geometry” (which’s usage is apparently not recommended) of each widget I need compared. The results were faulty or not what I needed them to be, as I had both widgets placed on top of each other, yet apparently they weren’t aligned.
This is the distance-calculation I use. Placing both widgets on top of each other, regardless of their anchors, should - imo - mean that the resulting float of the “Distance 2D” node equal zero. The “Current Quest Marker” being the marker-widget, and the “Event Map Spots” being the pre-defined map-coordinates for the existing events.
Thanks in advance for any answers (and sorry if there’s more info needed. First forum post)