เรียนรู้
Engine Class
Decal

*เนื้อหานี้แปลโดยใช้ AI (เวอร์ชัน Beta) และอาจมีข้อผิดพลาด หากต้องการดูหน้านี้เป็นภาษาอังกฤษ ให้คลิกที่นี่


สรุป
คุณสมบัติ
ColorMap:ContentId
MetalnessMap:ContentId
NormalMap:ContentId
RoughnessMap:ContentId
Shiny:number
เลิกใช้แล้ว
Specular:number
เลิกใช้แล้ว
Texture:ContentId
เลิกใช้แล้ว
TextureContent:Content
เลิกใช้แล้ว
TexturePack:ContentId
สมาชิกที่ได้รับทอด
ได้รับทอดโดย
ตัวอย่างโค้ด
การเปลี่ยนผิวของ Decal
-- สร้าง 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")
-- สร้าง decal
local decal = Instance.new("Decal")
decal.Face = Enum.NormalId.Top
decal.Parent = part
-- กำหนดหน้า
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
-- อีเวนต์ที่สัมผัส
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)
-- เพิ่มไปยัง workspace
part.Parent = workspace
การติดสติ๊กเกอร์ที่จางหาย
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") -- โลโก้ 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()

เอกสารอ้างอิงเกี่ยวกับ API
คุณสมบัติ
Color3
อ่านพร้อมๆ กัน
ความสามารถ: Basic
Decal.Color3:Color3
ตัวอย่างโค้ด
สี Decal Color3
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
ไม่ซ้ำ
อ่านพร้อมๆ กัน
ความสามารถ: Basic
Decal.ColorMap:ContentId

ColorMapContent
ไม่ซ้ำ
อ่านพร้อมๆ กัน
ความสามารถ: Basic
Decal.ColorMapContent:Content

LocalTransparencyModifier
ซ่อนอยู่
ไม่ซ้ำ
อ่านพร้อมๆ กัน
ความสามารถ: Basic
Decal.LocalTransparencyModifier:number

MetalnessMap
ซ่อนอยู่
การรักษาความปลอดภัยของปลั๊กอิน
อ่านพร้อมๆ กัน
ความสามารถ: Basic
Decal.MetalnessMap:ContentId

MetalnessMapContent
การรักษาความปลอดภัยของปลั๊กอิน
อ่านพร้อมๆ กัน
ความสามารถ: Basic
Decal.MetalnessMapContent:Content

NormalMap
ซ่อนอยู่
การรักษาความปลอดภัยของปลั๊กอิน
อ่านพร้อมๆ กัน
ความสามารถ: Basic
Decal.NormalMap:ContentId

NormalMapContent
การรักษาความปลอดภัยของปลั๊กอิน
อ่านพร้อมๆ กัน
ความสามารถ: Basic
Decal.NormalMapContent:Content

Rotation
อ่านพร้อมๆ กัน
ความสามารถ: Basic
Decal.Rotation:number

RoughnessMap
ซ่อนอยู่
การรักษาความปลอดภัยของปลั๊กอิน
อ่านพร้อมๆ กัน
ความสามารถ: Basic
Decal.RoughnessMap:ContentId

RoughnessMapContent
การรักษาความปลอดภัยของปลั๊กอิน
อ่านพร้อมๆ กัน
ความสามารถ: Basic
Decal.RoughnessMapContent:Content

Shiny
เลิกใช้แล้ว

Specular
เลิกใช้แล้ว

Texture
เลิกใช้แล้ว

TextureContent
เลิกใช้แล้ว

TexturePack
การรักษาความปลอดภัยของ Roblox
อ่านพร้อมๆ กัน
ความสามารถ: Basic
Decal.TexturePack:ContentId

Transparency
อ่านพร้อมๆ กัน
ความสามารถ: Basic
Decal.Transparency:number

UVOffset
อ่านพร้อมๆ กัน
ความสามารถ: Basic
Decal.UVOffset:Vector2

UVScale
อ่านพร้อมๆ กัน
ความสามารถ: Basic
Decal.UVScale:Vector2

ZIndex
อ่านพร้อมๆ กัน
ความสามารถ: Basic
Decal.ZIndex:number

©2026 Roblox Corporation. Roblox, โลโก้ Roblox และ Powering Imagination เป็นส่วนหนึ่งของเครื่องหมายการค้าที่จดทะเบียน และไม่ได้จดทะเบียนของเราในสหรัฐฯ และประเทศอื่นๆ