Skip to content

Home › Overview › ink

units ​

Types ​

Units type ​

luau
type Units = { scale: number, rem: number }

Properties ​

context Read Only ​

luau
units.context

The current scale.

Functions ​

px ​

luau
units.px(s: types.Scope, n: number): number

Returns a design-time pixel value, rounded to a whole pixel.

rem ​

luau
units.rem(s: types.Scope, n: number): number

Returns a multiple of the base size, scaled and rounded.

viewport_scale ​

luau
units.viewport_scale(viewport: Rect, reference_height: number, min: number?, max: number?): number

Returns a scale from the viewport height relative to a reference height.