Class · inherits UIComponent
UIShadow
Renders configurable shape or text shadows for the parent UI instance.
About UIShadow
UIShadow renders a shadow for its parent UI instance. Key features include:
- Adjust the shadow's blurriness with
BlurRadius. - Adjust the shadow's color and transparency with
ColorandTransparency. - Adjust the shadow's position and size relative to the parent with
OffsetandSpread. - Add multiple shadows under the same parent and adjust their render order
with
ZIndex. - Add a shadow to the text in
TextLabel,TextButton, orTextBoxwithMode. - Add an inset shadow with
Inset. - Hide the part of the shadow directly behind the parent with
ShowBehindParent. - Apply a gradient to a shadow's color with a child
UIGradient. - If the parent is rotated with
GuiObject.Rotation, the shadow will also be rotated. - If the parent has round corners with
UICorner, the shadow will also have round corners.
Limitations
UIShadowdoes not supportPath2D.- You cannot apply textures to a
UIShadow.
Properties 10
BlurRadius
: UDimDetermines the shadow's blurriness.This property determines the shadow's blurriness. A larger value makes the shadow's edges appear softer.
Note that the scale factor of this
UDimproperty is relative to the parent's width or height, whichever is shorter. This property must also be non-negative; a negative value will be treated as0.Color
: Color3Determines the shadow's color.This property determines the shadow's color.
Enabled
: booleanDetermines whether theUIShadowis visible.This property determines whether the
UIShadowis visible. Default istrue.Inset
: booleanDetermines whether theUIShadowis an inset shadow.When
true, the shadow appears on top of and inside the parent. Whenfalse, the shadow appears behind the parent.Defaults to
false. This property has no effect whenModeisApplyShadowMode.Text.Mode
: ApplyShadowModeDetermines whether theUIShadowapplies to the parent's shape or text.Determines whether the shadow applies to the parent's shape or text. Defaults to
ApplyShadowMode.Shape, which renders a shadow for the parent's rectangular area.ApplyShadowMode.Textrenders a shadow for text in aTextLabel,TextButton, orTextBox. On other classes, text mode renders no shadow.Shapemode andTextmode shadows can coexist under the same parent.The following properties have no effect in text mode:
Offset
: UDim2Moves the shadow relative to the parent's position.This property moves the shadow relative to the parent's position. The X scale factor is relative to the parent's width, and the Y scale factor is relative to the parent's height.
ShowBehindParent
: booleanDetermines whether the shadow renders directly behind the parent.When
true, the entire shadow is rendered. Whenfalse, the parent's shape masks the portion of the shadow directly behind it. Disabling this property prevents a shadow from obscuring content behind a transparent parent.Defaults to
true. This property has no effect whenModeisApplyShadowMode.TextorInsetistrue.Spread
: UDim2Expands or shrinks the shadow relative to the parent's size.This property expands or shrinks the shadow relative to the parent's size. The X scale factor is relative to the parent's width, and the Y scale factor is relative to the parent's height. Properties that are relative to the parent's size, such as the scale factors of
BlurRadiusandOffset, are not affected bySpread.This property has no effect when
ModeisApplyShadowMode.Text.When
Insetistrue, positiveSpreadvalues expand the shadow toward the center of the parent instead of outward.Transparency
: floatSets the shadow's transparency.This property sets the shadow's transparency, with
0being fully opaque and1being fully transparent.ZIndex
: intDetermines the shadow's render order relative to siblingUIShadowinstances.If a UI instance has multiple shadows, they are rendered in order of increasing
ZIndex. Since all shadows are rendered below the parent instance,ZIndexcan only be negative.
UIShadow also has every member of UIComponent. Deprecated and Roblox-only members are hidden.
Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.