UMG Set Position & Resolutions


I have read a number of threads addressing this, or a similar issue, but the fixes do not work for me, and I do not understand why. I simply want to put an image on the UMG canvas, and have it in the same relative position regardless of resolution/DPI. My initial canvas is 1920x1080, and so it would appear to be a simple math calc to adjust the image to a new position when the viewport size changes.

Alas, it does not. The math works, the set position looks to have correct numbers, but the image goes to the wrong spot on any other resolution… consistently… My image is set to topleft (0,0) anchor, and I have tried to use setmarkers to move it, but got the same result.

The following blueprint surely should work? What am I doing wrong?

Appreciate any help.


You’re applying the scale twice, effectively. The DPI Scale curve of UMG is taking a UI which is at 1080p 1:1 by default and scaling it by X. You’re also scaling marker locations by resolutions, effectively scaling them again. What you instead should be doing is transforming the viewport position into the 1:1 space of your UI, e.g what would the position be in 1080p space. Example: MarkerX * (1920 / ViewportSize.X).

Thanks, I wasn’t aware it worked this way! I gave it a go and now have Y working with all resolutions, but X is still a problem… will keep fiddling.