Reference API Roblox

Engine API

Website

Related

Reference API Roblox

Decal

The Decal object is an object which applies an image to a face of a BasePart.

Member index 7

HistoryMember
553Color3: Color3
553Shiny: float
553Specular: float
645Texture: ContentId
553Transparency: float
553ZIndex: int
inherited from FaceInstance
553Face: NormalId
inherited from Instance
553Archivable: bool
635Capabilities: SecurityCapabilities
553Name: string
553Parent: Instance
635Sandboxed: bool
616UniqueId: 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
486GetDescendants(): Array
486GetFullName(): string
641GetStyled(name: string): Variant
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
580IsPropertyModified(name: string): bool
573Remove(): null
576RemoveTag(tag: string): null
580ResetPropertyToDefault(name: 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()
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

The Decal object is an object which applies an image to a face of a BasePart.

How does a Decal work?

A Decal will apply an image to the BasePart it is parented to. The surface this image is applied to is dependent on the FaceInstance.Face property. The size of the decal is dependent on the size of the face, meaning the size and aspect ratio of a decal can be changed by changing its parent's BasePart.Size.

The image a Decal applies is determined by its Decal.Texture property. Images can be uploaded to Roblox provided they adhere to the community guidelines.For information on how to upload images, see Textures and Decals.

Alternatives to Decals

Although Decals have a wide variety of applications, in some cases developers may wish to pick one of the following classes instead.

  • For repeated tiled textures, the Texture object should be used
  • To apply GUI elements, the SurfaceGui object should be used
  • If the effect of lighting on the image needs to be altered, the SurfaceGui object should be used

History 30

Members 7

Color3

TypeDefault
Color31, 1, 1

The Color3 tint of the Decal.

Developers should note that this property only sets the tint of the decal, rather than the color. This means, unless the image associated with the Decal was originally white (RGB = 1,1,1) then the color cannot be freely changed using this property.

By reducing the RGB properties of Color3 in union, developers can make a decal darker.

History 4

Shiny

TypeDefault
float20

This property dictates how shiny the decal is. It takes a value between 0 and 1, where 1 is "full shininess".

This property is deprecated. It exists only for backward compatibility, and should not be used for new work.
This property is not replicated. Its interface does not cross the network boundary.

History 5

  • 553 Change Default of Shiny from to 20
  • 486 Change ThreadSafety of Shiny from ReadOnly to ReadSafe
  • 462 Change ThreadSafety of Shiny from to ReadOnly
  • 208 Change Tags of Shiny from [NotReplicated] to [NotReplicated, Deprecated]
  • 47 Add Shiny
Tags: [NotReplicated, Deprecated]

Specular

TypeDefault
float0

Sets the specularity, which is how the surface responds to light being shined on it.

This property is deprecated. It exists only for backward compatibility, and should not be used for new work.
This property is not replicated. Its interface does not cross the network boundary.

History 5

Tags: [NotReplicated, Deprecated]

Texture

TypeDefault
ContentId

The Content ID of the image to be applied by the Decal.

How can I upload a Decal?

Images can be uploaded to Roblox provided they adhere to the community guidelines. For information on how to upload images, see Textures and Decals.

How to find do I find a Decal's Content ID?

Unlike with Sound and Animation objects, the Content ID of a Decal is not the same as the number in the URL. There are two main ways of finding the Content ID of a Decal:

  • Paste the URL into the Texture property in Roblox Studio. Roblox will automatically update the property to the correct Content ID. Note this only works in Roblox Studio and cannot be done from Scripts or while the game is running.
  • Insert the Decal into the game, this is generally done through the Toolbox under 'My Decals'. The Content ID can be found in the decal that is inserted. Note, InsertService:LoadAsset() can also be used if developers wish to automate this method.

History 4

Transparency

TypeDefault
float0

Determines the transparency of the Decal with 0 being completely opaque and 1 completely transparent.

Note, Decals also respect the transparency of the original image file uploaded to Roblox. This means transparency can be changed prior to uploading to Roblox, and without the need to use the Transparency property.

Decal.LocalTransparencyModifier acts as a multiplier for the Decal's transparency and should be used when the transparency of the decal is likely to be changed by another script, as is the case with player Characters.

For BaseParts, see BasePart.Transparency.

History 4

ZIndex

TypeDefault
int1

ZIndex determines the order in which decals on the same Face of a BasePart are rendered. Decals are rendered in ascending priority order, where lower values are rendered first. Therefore, a decal with a higher ZIndex renders later (and on top of) other Decals with lower ZIndex.

The range of valid values is -MAX_INT to MAX_INT, inclusive (2,147,483,647 or (2^31 - 1)). If you are unsure if you will need to layer a decal between two already-existing decals in the future, it can be a good idea to use multiples of 100, i.e. 0, 100, 200. This ensures a large gap of ZIndex values you can use for elements rendered in-between other elements.

See also:

History 3

Settings