Aprenda
Classe do mecanismo
Decal

*Este conteúdo é traduzido por IA (Beta) e pode conter erros. Para ver a página em inglês, clique aqui.


Amostras de código
Mudando a Textura do Decalque
-- criar parte
local part = Instance.new("Part")
part.Size = Vector3.new(5, 1, 5)
part.Position = Vector3.new(0, 0.5, 0)
part.Anchored = true
part.TopSurface = Enum.SurfaceType.Smooth
part.BrickColor = BrickColor.new("Toothpaste")
-- criar decalque
local decal = Instance.new("Decal")
decal.Face = Enum.NormalId.Top
decal.Parent = part
-- definir faces
local happyFace = Content.fromUri("http://www.roblox.com/asset/?id=26424652")
local sadFace = Content.fromUri("http://www.roblox.com/asset/?id=147144198")
decal.ColorMapContent = happyFace
-- evento de toque
local cooldown = false
part.Touched:Connect(function(hit)
if not cooldown then
if hit and hit.Parent then
cooldown = true
sound:Play()
decal.ColorMapContent = sadFace
task.wait(1)
decal.ColorMapContent = happyFace
task.wait(0.2)
cooldown = false
end
end
end)
-- adicionar ao espaço de trabalho
part.Parent = workspace
Decal em Desvanecimento
local TweenService = game:GetService("TweenService")
local part = Instance.new("Part")
part.Size = Vector3.new(10, 10, 1)
part.Position = Vector3.new(0, 5, 0)
part.Anchored = true
part.Transparency = 1
local decal = Instance.new("Decal")
decal.Face = Enum.NormalId.Front
decal.ColorMapContent = Content.fromUri("http://www.roblox.com/asset/?id=699259085") -- logo do roblox
decal.Parent = part
part.Parent = workspace
local tween = TweenService:Create(
decal,
TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, -1, true),
{ Transparency = 1 }
)
tween:Play()

Referência API
Propriedades
Color3
Ler Parallel
Recursos: Basic
Decal.Color3:Color3
Amostras de código
Cor3 do Decal
local TweenService = game:GetService("TweenService")
local part = Instance.new("Part")
part.Size = Vector3.new(10, 10, 1)
part.Position = Vector3.new(0, 5, 0)
part.Anchored = true
part.Transparency = 1
local decal = Instance.new("Decal")
decal.Face = Enum.NormalId.Front
decal.ColorMapContent = Content.fromUri("http://www.roblox.com/asset/?id=1145367640")
decal.Parent = part
part.Parent = workspace
local redTween = TweenService:Create(
decal,
TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out),
{ Color3 = Color3.new(1, 0, 0) }
)
local greenTween = TweenService:Create(
decal,
TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out),
{ Color3 = Color3.new(0, 1, 0) }
)
local blueTween = TweenService:Create(
decal,
TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out),
{ Color3 = Color3.new(0, 0, 1) }
)
while true do
redTween:Play()
redTween.Completed:Wait()
greenTween:Play()
greenTween.Completed:Wait()
blueTween:Play()
blueTween.Completed:Wait()
end

ColorMap
Não replicado
Ler Parallel
Recursos: Basic
Decal.ColorMap:ContentId

ColorMapContent
Não replicado
Ler Parallel
Recursos: Basic
Decal.ColorMapContent:Content

LocalTransparencyModifier
Oculto
Não replicado
Ler Parallel
Recursos: Basic
Decal.LocalTransparencyModifier:number

MetalnessMap
Oculto
Segurança do plugin
Ler Parallel
Recursos: Basic
Decal.MetalnessMap:ContentId

MetalnessMapContent
Segurança do plugin
Ler Parallel
Recursos: Basic
Decal.MetalnessMapContent:Content

NormalMap
Oculto
Segurança do plugin
Ler Parallel
Recursos: Basic
Decal.NormalMap:ContentId

NormalMapContent
Segurança do plugin
Ler Parallel
Recursos: Basic
Decal.NormalMapContent:Content

Rotation
Ler Parallel
Recursos: Basic
Decal.Rotation:number

RoughnessMap
Oculto
Segurança do plugin
Ler Parallel
Recursos: Basic
Decal.RoughnessMap:ContentId

RoughnessMapContent
Segurança do plugin
Ler Parallel
Recursos: Basic
Decal.RoughnessMapContent:Content

Shiny
Obsoleto

Specular
Obsoleto

Texture
Obsoleto

TextureContent
Obsoleto

TexturePack
Segurança Roblox
Ler Parallel
Recursos: Basic
Decal.TexturePack:ContentId

Transparency
Ler Parallel
Recursos: Basic
Decal.Transparency:number

UVOffset
Ler Parallel
Recursos: Basic
Decal.UVOffset:Vector2

UVScale
Ler Parallel
Recursos: Basic
Decal.UVScale:Vector2

ZIndex
Ler Parallel
Recursos: Basic
Decal.ZIndex:number

©2026 Roblox Corporation, Roblox, o logotipo Roblox e Powering Imagination estão entre nossas marcas registradas e não registradas nos EUA e em outros países.