Udim2
Overview
Description
UDim2 is a data type used in OVERDARE Studio to define the size and position of UI elements. This value is calculated based on scale (fraction) and offset (pixel size). UDim2 is composed of two axes (X and Y) and is commonly used to set the size and position of UI elements in a flexible manner.
Constructors
new
UDim2.new is a constructor that creates a UDim2 object. It allows you to specify the scale and offset values for both the X and Y axes in detail to define the object.
Parameters
number xScale
X-axis scale
number xOffset
X-axis offset
number yScale
Y-axis scale
number yOffset
Y-axis offset
Return
UDim2
The newly created UDim2 object
Code Samples
local Position = UDim2.new(0.5, 10, 0.5, 20)
TextLabel.Position = Position
print(Position.X.Scale, Position.X.Offset, Position.Y.Scale, Position.Y.Offset)Properties
X
UDim Specifies the value for the X-axis. This value consists of two parts (scale and offset) that determine the size or position of a UI element using a combination of proportion and specific pixel sizes.
Code Samples
Y
UDim Specifies the value for the Y-axis. Similar to the X property, it uses scale and offset to determine the vertical size or position of a UI element.
Code Samples
Methods
Last updated
