[UMG] scale image to screen?

Hi, I want to make some opening credits ( the company logos when you open the game ) and I want my widget to simply fit an image to the screen. If I set the anchors to the corners, it won’t keep the image’s aspect ratio. if I check “size to content” it won’t fit to screen. How can I do it?

So you’re basically saying that you want the images to be max height (the height of the screen) and then have whatever width is appropriate?

If you want that then the calculation is maxscreenheight / image size y. That’ll get you a number that you then multiply the width by to keep the ratio. e.g.

An image with height 256 on a screen that’s 1080 would be 1080 /256 = 4.218
Now you multiply the width by that as well

Because you could also have the logos centered and a background that is anchored full-screen behind it

2 Likes

From what i have seen (never got to place where serious work on interface was required).
for development stage ppl do not care much about interface besides its functionality.
However for polishing most developers do separate sprites/textures and ui layouts for every supported resolution. Automatic scaling and stretching makes ugly artifacts.

For just logo, write down all resolutions, and load separate texture that fits. Automatic scaling for thing as important as logo is ugly.

1 Like

Thank you, in my case it looks like this)