Roblox UtilitiesDevlHub Roblox Documentation

Class

UIShadow

Inherits
UIComponent › UIBase › Instance › Object
Memory category
Instances

Renders a shadow below the parent UI instance.

UIShadow renders a drop shadow below its parent UI instance. Key features include:

  • Adjust the shadow's bluriness with BlurRadius.
  • Adjust the shadow's color and transparency with Color and Transparency.
  • Adjust the shadow's position and size relative to the parent with Offset and Spread.
  • Add multiple shadows under the same parent and adjust their render order with ZIndex.
  • 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#

  • UIShadow does not support text. If you add a UIShadow to a TextLabel or TextButton, it renders a shadow of the object's rectangular bounding area, not of the text.
  • UIShadow does not support inset shadows.
  • UIShadow does not support Path2D.
  • You cannot apply textures or UIGradients to a UIShadow.

Properties 7#

BlurRadiusUDimDetermines the shadow's blurriness.ReadSafe
ColorColor3Determines the shadow's color.ReadSafe
EnabledbooleanDetermines whether the UIShadow is visible.ReadSafe
OffsetUDim2Moves the shadow relative to the parent's position.ReadSafe
SpreadUDim2Expands or shrinks the shadow relative to the parent's size.ReadSafe
TransparencyfloatSets the shadow's transparency.ReadSafe
ZIndexintDetermines the shadow's render order relative to sibling UIShadow instances.ReadSafe

BlurRadius: UDim#

ReadSafe

This property determines the shadow's blurriness. A larger value makes the shadow's edges appear softer.

Note that the scale factor of this UDim property 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 as 0.

Color: Color3#

ReadSafe

This property determines the shadow's color.

Enabled: boolean#

ReadSafe

This property determines whether the UIShadow is visible. Default is true.

Offset: UDim2#

ReadSafe

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.

Spread: UDim2#

ReadSafe

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 BlurRadius and Offset, are not affected by Spread.

Transparency: float#

ReadSafe

This property sets the shadow's transparency, with 0 being fully opaque and 1 being fully transparent.

ZIndex: int#

ReadSafe

If a UI instance has multiple shadows, they are rendered in order of increasing ZIndex. Since all shadows are rendered below the parent instance, ZIndex can only be negative.

Inherited members#

Inherited from Instance 58
Inherited from Object 6
Properties (2)

ClassName, className

Events (1)

Changed