Skip to content

ImageScaleMode

interludesoftware.tick

Interlude.Tick

ImageScaleMode Enum

How an image fits inside its destination rect when its aspect ratio differs from the rect's. See the Image overloads on UI that accept this enum.

public enum ImageScaleMode

Fields

Stretch 0

Stretch the image to exactly fill the rect, ignoring aspect ratio. Default for the Image(Texture2D) overloads that don't take a mode.

Fit 1

Scale the image down so it fits *inside* the rect, preserving aspect ratio. The image is centred; the unfilled side gets letterboxed (or pillarboxed). CSS equivalent: object-fit: contain.

Fill 2

Scale the image so it *covers* the rect, preserving aspect ratio. The overflow on the longer side is clipped to the rect bounds. CSS equivalent: object-fit: cover.