Skip to Content
Kinemium
Datatypes

Interface and timing

UDim, UDim2, Rect, TweenInfo, Font, and DockWidgetPluginGuiInfo.

UDim

UDim pairs a scale with a pixel offset. UI sizes and positions use it through UDim2.

ConstructorDescription
UDim.new(scale?, offset?)Both values default to 0.
MemberTypeDescription
ScalenumberScale factor.
OffsetnumberPixel offset.
MethodReturnsDescription
Lerp(goal, alpha)UDimInterpolates both components.
FuzzyEq(other, epsilon?)booleanApproximate comparison. epsilon defaults to 1e-5.

Supports +, -, and ==.

UDim2

UDim2.new(xScale?, xOffset?, yScale?, yOffset?) combines two UDim values. Every component defaults to 0.

local size = UDim2.fromScale(0.5, 0.25)
local inset = UDim2.fromOffset(320, 40)
frame.Size = size
frame.Position = UDim2.new(0.5, 0, 0.5, 0)
MemberTypeDescription
X, WidthUDimHorizontal scale and offset.
Y, HeightUDimVertical scale and offset.
XScalenumberHorizontal scale.
XOffsetnumberHorizontal pixel offset.
YScalenumberVertical scale.
YOffsetnumberVertical pixel offset.
Constructor or methodReturnsDescription
UDim2.fromScale(x, y)UDim2Scale only, with zero offsets.
UDim2.fromOffset(x, y)UDim2Offsets only, with zero scales.
UDim2.zeroUDim2All components zero.
Lerp(goal, alpha)UDim2Interpolates all four components.
FuzzyEq(other, epsilon?)booleanApproximate comparison. epsilon defaults to 1e-5.

Supports +, -, and ==.

Rect

Rect describes a 2D rectangle by its minimum and maximum corners.

ConstructorDescription
Rect.new()Zero-size rectangle at the origin.
Rect.new(min, max)From two Vector2 corners.
Rect.new(minX, minY, maxX, maxY)From four numbers.
MemberTypeDescription
MinVector2Minimum corner.
MaxVector2Maximum corner.
WidthnumberWidth, computed from Min and Max.
HeightnumberHeight, computed from Min and Max.

TweenInfo

TweenInfo holds the timing for TweenService.

local TweenService = game:GetService("TweenService")
local info = TweenInfo.new(0.4, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
TweenService:Create(part, info, { Transparency = 1 }):Play()
ArgumentDefaultDescription
time1Duration in seconds. Must be >= 0.
easingStyleEnum.EasingStyle.QuadEasing curve.
easingDirectionEnum.EasingDirection.OutDirection of the curve.
repeatCount0Repeats after the first play. Must be >= -1.
reversesfalsePlay backward after finishing.
delayTime0Seconds before the tween starts. Must be >= 0.
MemberTypeDescription
TimenumberDuration in seconds.
EasingStyleEnum.EasingStyleEasing curve.
EasingDirectionEnum.EasingDirectionDirection of the curve.
RepeatCountnumberRepeat count.
ReversesbooleanWhether it reverses.
DelayTimenumberDelay in seconds.

Font

Font stores a family, weight, and style. Text properties accept it alongside Enum.Font.

local font = Font.new("Montserrat", Enum.FontWeight.SemiBold)
label.FontFace = font
ConstructorDescription
Font.new(family, weight?, style?)weight defaults to Enum.FontWeight.Regular and style to Enum.FontStyle.Normal.
Font.fromEnum(enum)Converts an Enum.Font value.
Font.fromName(name)Uses a known Enum.Font name when possible, otherwise treats the string as a family.
Font.fromMemory(data, weight?, style?)Builds a font from font file bytes.
MemberTypeDescription
FamilystringFont family name.
FromMemorybooleanWhether the font came from memory data.
WeightEnum.FontWeightFont weight.
StyleEnum.FontStyleFont style.
Boldbooleantrue when the weight is 600 or heavier.

DockWidgetPluginGuiInfo

Hints for creating a dock widget. Editor and plugin code use it.

DockWidgetPluginGuiInfo.new(initialDockState?, initialEnabled?, overrideEnabledRestore?, floatingXSize?, floatingYSize?, minWidth?, minHeight?)

ArgumentDefaultDescription
initialDockStateEnum.InitialDockState.TopStarting dock position.
initialEnabledtrueWhether the widget starts enabled.
overrideEnabledRestorefalseWhether to override the saved enabled state.
floatingXSize0Floating width.
floatingYSize0Floating height.
minWidth0Minimum width.
minHeight0Minimum height.
MemberTypeDescription
InitialDockStateEnum.InitialDockStateStarting dock position.
InitialEnabledbooleanStarting enabled state.
InitialEnabledShouldOverrideRestorebooleanRestore override flag.
FloatingXSizenumberFloating width.
FloatingYSizenumberFloating height.
MinWidthnumberMinimum width.
MinHeightnumberMinimum height.

See also

On this page