Pelajari
Kelas Engine
Decal

*Konten ini diterjemahkan menggunakan AI (Beta) dan mungkin mengandung kesalahan. Untuk melihat halaman ini dalam bahasa Inggris, klik di sini.


Rangkuman
Anggota yang Diwariskan
Diwariskan oleh
Contoh Kode
Mengubah Tekstur Decal
-- buat part
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")
-- buat decal
local decal = Instance.new("Decal")
decal.Face = Enum.NormalId.Top
decal.Parent = part
-- definisikan wajah
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
-- event ketika disentuh
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)
-- tambahkan ke workspace
part.Parent = workspace
Dekal Memudar
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 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()

Referensi API
Properti
Color3
Baca Paralel
Kemampuan: Basic
Decal.Color3:Color3
Contoh Kode
Warna 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
Tidak Direplikasi
Baca Paralel
Kemampuan: Basic
Decal.ColorMap:ContentId

ColorMapContent
Tidak Direplikasi
Baca Paralel
Kemampuan: Basic
Decal.ColorMapContent:Content

LocalTransparencyModifier
Tersembunyi
Tidak Direplikasi
Baca Paralel
Kemampuan: Basic
Decal.LocalTransparencyModifier:number

MetalnessMap
Tersembunyi
Keamanan Plugin
Baca Paralel
Kemampuan: Basic
Decal.MetalnessMap:ContentId

MetalnessMapContent
Keamanan Plugin
Baca Paralel
Kemampuan: Basic
Decal.MetalnessMapContent:Content

NormalMap
Tersembunyi
Keamanan Plugin
Baca Paralel
Kemampuan: Basic
Decal.NormalMap:ContentId

NormalMapContent
Keamanan Plugin
Baca Paralel
Kemampuan: Basic
Decal.NormalMapContent:Content

Rotation
Baca Paralel
Kemampuan: Basic
Decal.Rotation:number

RoughnessMap
Tersembunyi
Keamanan Plugin
Baca Paralel
Kemampuan: Basic
Decal.RoughnessMap:ContentId

RoughnessMapContent
Keamanan Plugin
Baca Paralel
Kemampuan: Basic
Decal.RoughnessMapContent:Content

Shiny
Tidak digunakan lagi

Specular
Tidak digunakan lagi

Texture
Tidak digunakan lagi

TextureContent
Tidak digunakan lagi

TexturePack
Keamanan Roblox
Baca Paralel
Kemampuan: Basic
Decal.TexturePack:ContentId

Transparency
Baca Paralel
Kemampuan: Basic
Decal.Transparency:number

UVOffset
Baca Paralel
Kemampuan: Basic
Decal.UVOffset:Vector2

UVScale
Baca Paralel
Kemampuan: Basic
Decal.UVScale:Vector2

ZIndex
Baca Paralel
Kemampuan: Basic
Decal.ZIndex:number

©2026 Roblox Corporation. Roblox, logo Roblox, dan Powering Imagination termasuk dalam merek dagang kami yang terdaftar dan tidak terdaftar di AS dan negara lainnya.