Image ScaleType "Fit"

While working on GUI, I realized that roblox doesn’t have a “fit” ScaleType for Images. This would be a great addition to add to prevent weirdly stretched images. Of course, it’s possible to do it yourself, but it requires another gui object and a lot of settings changed for the image object, and I think you might need a script.

Here’s a personal use case:

Currently working on one of these inventory systems for fun. If you look at the bottom two objects, you’ll notice how one is stretched and the other isn’t. While the original money bag was 3x3 (which looked okay,) I decided the money bag might need to take more space (for prototyping purposes.) When I increased the 3x3 to 3x4, it became stretched. I immediately checked to see if there was a fit ScaleType setting, but there wasn’t.

Currently, we can only stretch. If we could set the ScaleType to “fit,” it would look like the one on the right.

EDIT: It was brought to my attention that you can use “UIAspectRatioConstraint,” but you’ll still need two objects. (One for the frame back, then the image with the constraint inside the image.) You’d also would have to know the aspect ratio of the image, which I don’t think you can get without knowing the size outside of roblox (check me on that.)

16 Likes

I really like this idea!

I’ve made a proposal to add this, a lot of us like the idea internally.

4 Likes

If there’s Fit, then I feel that there should be a Fill scale type too!

2 Likes

@Crazyman32, what do you mean by fill scale type?

Presumably one where it crops instead of insetting. Not as sure about that one.

When trying to make larger splash images for whatever reason (like some banner image), having a ‘fill’ option would be super helpful!

1 Like

Oh I see, just remembered how the “fill” worked from windows xp when setting desktop background scale type. :stuck_out_tongue:

I’ve proposed adding Crop as well. We’ll see how it goes.

RobloxScreenShot20180308_122926192

29 Likes

These would be amazing additions.

1 Like

How about alignment of fitted and cropped images - is there enough use in allowing this to be considered?

1 Like

The new scale types Fit/Crop are now enabled on production.

10 Likes

So does this mean they’re actively being worked on, Tiffblocks?

It means that you can open Studio right now and use them.

1 Like

Oh that’s awesome!

That has to be the quickest update I’ve ever seen. :stuck_out_tongue:

This is a great addition!

3 Likes

Thanks a ton! I was actually going to make a suggestion for this a few hours ago and then I saw this. :stuck_out_tongue: (I didn’t actually see them until after this cause I assumed they weren’t there lol)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.