Aprender
Clase de motor
Decal

*Este contenido se traduce usando la IA (Beta) y puede contener errores. Para ver esta página en inglés, haz clic en aquí.


Muestras de código
Cambiando la textura del decal
-- crear 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")
-- crear decal
local decal = Instance.new("Decal")
decal.Face = Enum.NormalId.Top
decal.Parent = part
-- definir caras
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 tocado
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)
-- añadir al espacio de trabajo
part.Parent = workspace
Calcomanía Desvanecida
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 de 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()

Referencia API
Propiedades
Color3
Leer paralelo
Capacidades: Basic
Decal.Color3:Color3
Muestras de código
Color3 de 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
No replicado
Leer paralelo
Capacidades: Basic
Decal.ColorMap:ContentId

ColorMapContent
No replicado
Leer paralelo
Capacidades: Basic
Decal.ColorMapContent:Content

LocalTransparencyModifier
Oculto
No replicado
Leer paralelo
Capacidades: Basic
Decal.LocalTransparencyModifier:number

MetalnessMap
Oculto
Seguridad del plugin
Leer paralelo
Capacidades: Basic
Decal.MetalnessMap:ContentId

MetalnessMapContent
Seguridad del plugin
Leer paralelo
Capacidades: Basic
Decal.MetalnessMapContent:Content

NormalMap
Oculto
Seguridad del plugin
Leer paralelo
Capacidades: Basic
Decal.NormalMap:ContentId

NormalMapContent
Seguridad del plugin
Leer paralelo
Capacidades: Basic
Decal.NormalMapContent:Content

Rotation
Leer paralelo
Capacidades: Basic
Decal.Rotation:number

RoughnessMap
Oculto
Seguridad del plugin
Leer paralelo
Capacidades: Basic
Decal.RoughnessMap:ContentId

RoughnessMapContent
Seguridad del plugin
Leer paralelo
Capacidades: Basic
Decal.RoughnessMapContent:Content

Shiny
Obsoleto

Specular
Obsoleto

Texture
Obsoleto

TextureContent
Obsoleto

TexturePack
Seguridad de Roblox
Leer paralelo
Capacidades: Basic
Decal.TexturePack:ContentId

Transparency
Leer paralelo
Capacidades: Basic
Decal.Transparency:number

UVOffset
Leer paralelo
Capacidades: Basic
Decal.UVOffset:Vector2

UVScale
Leer paralelo
Capacidades: Basic
Decal.UVScale:Vector2

ZIndex
Leer paralelo
Capacidades: Basic
Decal.ZIndex:number

©2026 Roblox Corporation. Roblox, el logotipo de Roblox y "Powering Imagination" son algunas de nuestras marcas registradas y no registradas en los Estados Unidos y otros países.