Skip to content

Insets

Global · Insets · server and client scripts

Insets creates an immutable four-edge offset (Left, Top, Right, Bottom) used for UI padding, hit slop, safe areas, and nine-slice borders. To read edge values on a value, see Insets.

new

Function
new(left: number, top: number, right: number, bottom: number) -> Insets

Insets.new creates an Insets from four finite numbers (left, top, right, bottom).

Example

-- Client script.
local pad = Insets.new(12, 8, 12, 8)
print(pad.Left, pad.Top) -- prints 12   8

all

Function
all(n: number) -> Insets

Insets.all creates an Insets with all four edges set to n.

Example

-- Client script.
local pad = Insets.all(8)
print(pad.Left, pad.Bottom) -- prints 8 8

Zero

PropertyRead only
Zero: Insets

Insets.Zero is the zero Insets (0, 0, 0, 0).

Default Insets.new(0, 0, 0, 0)