Decal
The Decal object is an object which applies an image to a face of a BasePart.
Memory category | GraphicsTexture |
---|
Member index 7
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
- 645 Change ValueType of Texture from Content to ContentId
- 553 Change Default of ZIndex from to 1
- 553 Change Default of Transparency from to 0
- 553 Change Default of Specular from to 0
- 553 Change Default of Shiny from to 20
- 553 Change Default of from to 0
- 553 Change Default of Color3 from to Color3(1, 1, 1)
- 486 Change ThreadSafety of ZIndex from ReadOnly to ReadSafe
- 486 Change ThreadSafety of Transparency from ReadOnly to ReadSafe
- 486 Change ThreadSafety of Texture from ReadOnly to ReadSafe
- 486 Change ThreadSafety of Specular from ReadOnly to ReadSafe
- 486 Change ThreadSafety of Shiny from ReadOnly to ReadSafe
- 486 Change ThreadSafety of from ReadOnly to ReadSafe
- 486 Change ThreadSafety of Color3 from ReadOnly to ReadSafe
- 483 Add ZIndex
- 462 Change ThreadSafety of Transparency from to ReadOnly
- 462 Change ThreadSafety of Texture from to ReadOnly
- 462 Change ThreadSafety of Specular from to ReadOnly
- 462 Change ThreadSafety of Shiny from to ReadOnly
- 462 Change ThreadSafety of from to ReadOnly
- 462 Change ThreadSafety of Color3 from to ReadOnly
- 274 Add Color3
- 208 Change Tags of Specular from [NotReplicated] to [NotReplicated, Deprecated]
- 208 Change Tags of Shiny from [NotReplicated] to [NotReplicated, Deprecated]
- 178 Add
- 47 Add Transparency
- 47 Add Texture
- 47 Add Specular
- 47 Add Shiny
- 47 Add Decal
Members 7
Color3
Type | Default | |
---|---|---|
Color3 | 1, 1, 1 |
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.
Thread safety | ReadSafe |
---|---|
Category | Appearance |
Loaded/Saved | true |
Shiny
Type | Default | |
---|---|---|
float | 20 |
This property dictates how shiny the decal is. It takes a value between 0 and 1, where 1 is "full shininess".
Thread safety | ReadSafe |
---|---|
Category | Appearance |
Loaded/Saved | true/false |
Specular
Type | Default | |
---|---|---|
float | 0 |
Sets the specularity, which is how the surface responds to light being shined on it.
Thread safety | ReadSafe |
---|---|
Category | Appearance |
Loaded/Saved | true/false |
Texture
Type | Default | |
---|---|---|
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.
Thread safety | ReadSafe |
---|---|
Category | Appearance |
Loaded/Saved | true |
Transparency
Type | Default | |
---|---|---|
float | 0 |
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.
Thread safety | ReadSafe |
---|---|
Category | Appearance |
Loaded/Saved | true |
History 4
- 553 Change Default of Transparency from to 0
- 486 Change ThreadSafety of Transparency from ReadOnly to ReadSafe
- 462 Change ThreadSafety of Transparency from to ReadOnly
- 47 Add Transparency
ZIndex
Type | Default | |
---|---|---|
int | 1 |
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:
- GuiObject.ZIndex, a property which behaves similarly, but for GUI elements
Thread safety | ReadSafe |
---|---|
Category | Appearance |
Loaded/Saved | true |