Class
UICorner
UI modifier which applies deformation to corners of its parent
GuiObject.
UICorner is a modifier which applies deformation to corners of its parent
GuiObject. Input, but not descendants, will be clipped to the round
corner area. See
UI appearance modifiers for
examples.
In order to keep the circular shape of round corners, each corner radius
(UDim) is internally calculated as follows:
- The radius of the X axis is always the same as the radius of Y axis.
Scalerounding will always apply to the minimum width or height.- Rounded rectangles will always be in a "pill" shape if
CornerRadiusis set to a value that leads to a calculated result greater than half of the rectangle's minimum width or height.
Alternatively to UICorner, rounded corners can be accomplished using
slices which are suitable for decorative borders that are not simply
rounded. See 9‑Slice Design for details.
Note that UICorner can not be applied to a ScrollingFrame.
Individual Corners#
Each corner has its own radius property
(TopLeftRadius,
TopRightRadius,
BottomRightRadius,
BottomLeftRadius). The
CornerRadius property is a convenience shorthand
that sets all four corners at once and reads from
TopLeftRadius.
When using styling with UICorner, avoid
configuring both CornerRadius and the individual
corner radii in style rules at the same time, as this may produce unexpected
results.
Properties 5#
BottomLeftRadiusUDim | Determines the radius of the bottom-left corner.ReadSafe |
BottomRightRadiusUDim | Determines the radius of the bottom-right corner.ReadSafe |
CornerRadiusUDim | Sets all four corner radii at once and reads from
TopLeftRadius.ReadSafeNotReplicated |
TopLeftRadiusUDim | Determines the radius of the top-left corner.ReadSafe |
TopRightRadiusUDim | Determines the radius of the top-right corner.ReadSafe |
BottomLeftRadius: UDim#
ReadSafe
This property is currently in beta. To use it, enable New UI Capabilities in Studio's beta features window.
A UDim property that determines the radius of the bottom-left
corner independently. Setting CornerRadius
overwrites all four individual corner radii to the same value.
BottomRightRadius: UDim#
ReadSafe
This property is currently in beta. To use it, enable New UI Capabilities in Studio's beta features window.
A UDim property that determines the radius of the bottom-right
corner independently. Setting CornerRadius
overwrites all four individual corner radii to the same value.
CornerRadius: UDim#
NotReplicatedReadSafe
A convenience UDim property that acts as a shorthand for the
four individual corner radius properties. Writing to this property sets
TopLeftRadius,
TopRightRadius,
BottomRightRadius, and
BottomLeftRadius to the same value.
Reading this property returns the value of
TopLeftRadius.
TopLeftRadius: UDim#
ReadSafe
This property is currently in beta. To use it, enable New UI Capabilities in Studio's beta features window.
A UDim property that determines the radius of the top-left
corner independently. Setting CornerRadius
overwrites all four individual corner radii to the same value.
TopRightRadius: UDim#
ReadSafe
This property is currently in beta. To use it, enable New UI Capabilities in Studio's beta features window.
A UDim property that determines the radius of the top-right
corner independently. Setting CornerRadius
overwrites all four individual corner radii to the same value.
Inherited members#
Inherited from Instance 58
Properties (10)
Archivable, archivable, Capabilities, IsInSandbox, Name, Parent, PredictionMode, RobloxLocked, Sandboxed, UniqueId
Methods (39)
AddTag, children, ClearAllChildren, Clone, clone, Destroy, destroy, FindFirstAncestor, FindFirstAncestorOfClass, FindFirstAncestorWhichIsA, FindFirstChild, findFirstChild, FindFirstChildOfClass, FindFirstChildWhichIsA, FindFirstDescendant, GetActor, GetAttribute, GetAttributeChangedSignal, GetAttributes, GetChildren, getChildren, GetDebugId, GetDescendants, GetFullName, GetStyled, GetStyledPropertyChangedSignal, GetTags, HasTag, IsAncestorOf, IsDescendantOf, isDescendantOf, IsPropertyModified, QueryDescendants, Remove, remove, RemoveTag, ResetPropertyToDefault, SetAttribute, WaitForChild