Reference API Roblox

Engine API

Website

Related

Reference API Roblox

UIShadow

Renders configurable shape or text shadows for the parent UI instance.

Member index 10

HistoryMember
711BlurRadius: UDim
711Color: Color3
724Enabled: bool
733Inset: bool
732Mode: ApplyShadowMode
711Offset: UDim2
733ShowBehindParent: bool
711Spread: UDim2
711Transparency: float
711ZIndex: int
inherited from Instance
553Archivable: bool
670Capabilities: SecurityCapabilities
723IsInSandbox: bool
553Name: string
553Parent: Instance
702PredictionMode: PredictionMode
670Sandboxed: bool
680UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
707GetDescendants(): Instances
486GetFullName(): string
706GetStyled(name: string, selector: string?): Variant
657GetStyledPropertyChangedSignal(property: string): RBXScriptSignal
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
664IsPropertyModified(property: string): bool
698QueryDescendants(selector: string): Instances
573Remove(): null
576RemoveTag(tag: string): null
664ResetPropertyToDefault(property: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
648children(): Instances
553clone(): Instance
573destroy(): null
553findFirstChild(name: string, recursive: bool = false): Instance
648getChildren(): Instances
553isDescendantOf(ancestor: Instance): bool
573remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
657StyledPropertiesChanged()
553childAdded(child: Instance)
inherited from Object
647ClassName: string
647className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
650isA(className: string): bool
647Changed(property: string)

Description

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 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.
  • Add a shadow to the text in TextLabel, TextButton, or TextBox with Mode.
  • 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

  • UIShadow does not support Path2D.
  • You cannot apply textures to a UIShadow.

History 13

Members 10

BlurRadius

TypeDefault
UDim0, 0

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.

History 1

Color

TypeDefault
Color30, 0, 0

This property determines the shadow's color.

History 1

Enabled

TypeDefault
booltrue

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

History 1

Inset

TypeDefault
boolfalse

When true, the shadow appears on top of and inside the parent. When false, the shadow appears behind the parent.

Defaults to false. This property has no effect when Mode is ApplyShadowMode.Text.

History 1

Mode

TypeDefault
ApplyShadowModeShape

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.Text renders a shadow for text in a TextLabel, TextButton, or TextBox. On other classes, text mode renders no shadow.

Shape mode and Text mode shadows can coexist under the same parent.

The following properties have no effect in text mode:

History 1

Offset

TypeDefault
UDim2{0, 0}, {0, 0}

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.

History 1

ShowBehindParent

TypeDefault
booltrue

When true, the entire shadow is rendered. When false, 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 when Mode is ApplyShadowMode.Text or Inset is true.

History 1

Spread

TypeDefault
UDim2{0, 0}, {0, 0}

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.

This property has no effect when Mode is ApplyShadowMode.Text.

When Inset is true, positive Spread values expand the shadow toward the center of the parent instead of outward.

History 1

Transparency

TypeDefault
float0

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

History 1

ZIndex

TypeDefault
int-1

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.

History 1

Settings