Scale Box not keeping aspect ratio

Hi all, I’m not sure if this is the forum for this, but this was the closest one to Widget design, I guess.

I’m trying to make a simple UI element which is basically a sprite and a text beneath, and the sprite is supposed to be scaled to match the area, which is why I’m using a Scale Box, which I suppose is expected.


But the result I’m getting is that the star graphics (which are supposed to be 1:1) gets stretched anyway despite what the description of the Stretch attribute says (it’s supposed to scale on X and then match the aspect ratio):

Is there some specific way to use these elements (Scale Box inside a Vertical Box) that I’m not getting here? Should I do something else to get the result I’m expecting instead?

Could you share the settings for the star graphic?
9/10 times the issue is the settings on the content of the slots rather then the slot setup…

Sure thing!

The vertical alignment is set to stretch. what happens if you set it to be vertically centered (like you have it for horizontal?

Also, what is the outcome you would expect?

The star stretching to fit the container, or the star being a fixed size and the container accommodating it?

I expect the star stretching in the x-axis to fill the box and the y-axis following to keep it square.

You were right, though, setting it to centered or top-aligned made the star finally keep its aspect ratio like I intended. I’m feeling stupid XD.

Thanks a lot :slight_smile:

Don’t feel stupid, the umg system is by far the most counterintuitive one. The reason I guessed what the issue was is I probably banged my had on the keyboard too.