| title | Textures and decals |
|---|---|
| description | Textures and decals are images you can place on object surfaces. |
A Class.Texture is an image you can place on any face of a part or union that repeats both horizontally and vertically on the size of the surface. In contrast, a Class.Decal is an image that stretches to fit the area of a part or union's surface. After you
add a Class.Texture or Class.Decal object to a part or union, you can:
-
Change the texture or decal
Class.Decal.Color3|Color3property to set a color tint using RGB color codes. -
Change the texture or decal
Class.Decal.Transparency|Transparencyproperty to a value between the default of 0 (fully visible) and 1 (invisible).
To create a texture or decal, you must add either a Class.Texture or Class.Decal object to a part or union. You can import images for textures and decals to Studio for use between experiences, and distribute them to the Creator Store. Once you import the image, Studio assigns it a unique asset ID.
To add a texture or decal to a part or union:
-
In the Explorer window, add a
Class.TextureorClass.Decalto the part or union. An empty texture or decal object displays on the part or union with orange outlining. -
In the Properties window, navigate to the
Class.FaceInstance.Face|Faceproperty and choose a face (Enum.NormalId|Top,Enum.NormalId|Bottom,Enum.NormalId|Front,Enum.NormalId|Back,Enum.NormalId|Left, orEnum.NormalId|Right). -
Select the
Class.Decal.ColorMapContent|ColorMapContentproperty and apply an image through any of the following methods:- Select any texture or decal you've uploaded previously.
- Enter an asset ID into the field.
-
Set a color tint by clicking the small box to the left of the
Class.Decal.Color3|Color3property or by entering a RGB color code.
`Class.Decal.Color3|Color3`: [255, 255, 255]
`Class.Decal.Color3|Color3`: [255, 0, 100]
-
Set the
Class.Decal.Transparency|Transparencyproperty to any value between the default of0(fully visible) and1(invisible).
`Class.Decal.Transparency|Transparency`: 0
`Class.Decal.Transparency|Transparency`: 0.6
Unlike decals, textures provide further functionality to scale, offset, and animate the source image.
The size of the part doesn't affect the texture. Instead, scaling a part only increases or decreases the number of times the texture repeats.
The Class.Texture.StudsPerTileU|StudsPerTileU and Class.Texture.StudsPerTileV|StudsPerTileV properties determine the size of each "tile" in studs. Class.Texture.StudsPerTileU|StudsPerTileU determines the texture's horizontal size while Class.Texture.StudsPerTileV|StudsPerTileV determines the texture's vertical size.
If you want more control over a texture's position, offset the texture by adjusting the Class.Texture.OffsetStudsU|OffsetStudsU (horizontal) and Class.Texture.OffsetStudsV|OffsetStudsV (vertical) properties. This is also helpful for animation.
Using Class.TweenService, you can tween texture properties like Class.Texture.OffsetStudsU|OffsetStudsU and Class.Texture.StudsPerTileV|StudsPerTileV to achieve animated surfaces. For example, if you apply two fog textures to one container and animate them with the following script, you can achieve the appearance of a layered moving fog.
local TweenService = game:GetService("TweenService")
local texture1 = script.Parent.Texture1
local texture2 = script.Parent.Texture2
local tweenInfo1 = TweenInfo.new(8, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, -1)
local tween1 = TweenService:Create(texture1, tweenInfo1, {OffsetStudsV=50})
local tweenInfo2 = TweenInfo.new(7, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, -1, true)
local tween2 = TweenService:Create(texture2, tweenInfo2, {OffsetStudsU=50, StudsPerTileU=55, StudsPerTileV=45})
tween1:Play()
tween2:Play()






