AspectImage

BaCu

(1)
$4
Publisher BaCu
File size 2.08MB
Number of files 9
Latest version 1
Latest release date 2021-04-15 01:01:13
First release date 2021-04-15 01:01:13
Supported Unity versions 2018.4.2 or higher
AspectImage is an Image class that inherits from the Image class for Canvas and can set the aspect ratio.

The following three types can be specified with AspectImage.

1. Scale To Fill
Sprite is stretched to the same size as RectTransform and displayed. The aspect ratio will not be maintained.

2. Aspect Fit
Maintains the aspect ratio and draws with the maximum size that does not go out of the drawing range of RectTransform.

3. Aspect Fill
Maintains the aspect ratio and draws the image with the minimum size within the RectTransform's drawing range.

Since it inherits from Image, it also works with Mask, Shadow, Material, and other functions available in Image.

It can be generated in the same way as the regular Image class by right-clicking in the Hierarchy and selecting "UI > AspectImage".

Top Publisher Assets