For some reason the constraint’s dominant axis is not changing from height. I’ve set it to width, tried cutting and pasting and deleting the element and the constraint, and have messed with the aspect type to no avail.
Firstly, why not put the UIAspectRatioConstraint in the frame rather than the ImageLabel? All children of something with a Aspect Ratio Constraint also follow the same constraint automatically.
However, the issue is with your “AspectRatio” value. Play around with this until you get the correct size. If you want the exact same size as it was without the constraint, write down the ImageLabel’s original “AbsoluteSize” and alter the AspectRatio value until the new AbsoluteSize is the same.
Yes, it will. I want my image to always reach the bounds on each side of the rectangular ancestor frame. The original image is square, so to preserve its scaling, the ImageLabel also has to be square.
Is it possible you could message me a place file with this UI in it? I could possibly play around with different values and see what I can do to help you.
Have you tried changing the aspect type and then changing the dominantaxis back and forth? I’ve always found the aspect ratio constrains to be very fiddley
Why are you using an aspect ratio constraint to make a blurred map of the original map to fill unused space? The way a constraint functions is it will keep everything equal in size (or proportional). Because your UI is set up to extend based on the resolution, this would not be what you are looking for as no one value would fill the empty space on every device.
I am using it to keep the image square while making it resize with the frame it is in. The only point of it is to keep the image square.
And the one value that would fit in the space is {1,0},{1,0}.
However, I don’t want my scaled image to be stretched - the original image was square, so that means I’ll need to overcompensate to fit a rectangular space.
In some rare cases it may wider than it is tall, however the game will only be available on PC and XBOX, meaning that screens will usually be taller than the width of the element.
I’m not really designing it for those; however in the case they do get used, then the frame included in this topic will clip the image.
This works as long as “back” doesn’t switch to be more horizontal than vertical, and even then you could give it some leniency if you changed the aspect ratio of the inner square to be like 1.2 or 1.4 and uploaded wider images so it has a little bit of a “bleed”
All I did was set the width of the imagelabel to be Scale = 5. This way the height should always be the “max” extent