Udim

Overview

Description

UDim is a structure used to handle dimension properties, primarily in user interfaces (UI). It allows combining a scale (proportion-based) and offset (pixel-based) value for more flexible UI positioning and sizing.

Properties

Scale

number

Defines the proportional component of the UDim, where 1.0 represents 100%. It is used to define sizes and positions relative to the parent container.

Code Samples

local UDim = UDim.new(0.5, 0)

Offset

number

Defines the fixed pixel-based component of the UDim. This determines the additional fixed size or position added to the value provided by the Scale.

Code Samples

local UDim = UDim.new(0, 100)

Constructors

new

Creates a new UDim object with the specified Scale and Offset values.

Parameters

number InScale

The scale component of the UDim (proportional).

number InOffset

The offset component of the UDim (fixed in pixels).

Return

UDim

A new UDim instance configured with the provided Scale and Offset values.

Code Samples

local UDim = UDim.new(0.5, 100)

Methods

Last updated