Skip to content

AspectRatio ​

Locks a widget to a specific aspect ratio.

luau
PeanutUI.Frame {
    aspectRatio = {
        ratio = 16 / 9,
        type = "FitWithinMaxSize",
    }
}

Properties ​

PropertyTypeDescription
rationumberWidth-to-height ratio.
type"FitWithinMaxSize" | "ScaleWithParentSize"How the ratio is enforced.
dominantAxis"Width" | "Height"Axis that drives the ratio.