學習
引擎類別
WireframeHandleAdornment

*此內容是使用 AI(Beta 測試版)翻譯,可能含有錯誤。若要以英文檢視此頁面,請按一下這裡


概要
方法
AddLine(from: Vector3,to: Vector3):()
AddLines(points: {any}):()
AddPath(points: {any},loop: boolean):()
AddText(point: Vector3,text: string,size: number):()
Clear():()
繼承成員
範例程式碼
基本路徑框架
local wireframe = script.Parent
-- 在方形排列中聲明四個點
local pathArray = {
Vector3.new(-10, 10, 0),
Vector3.new(10, 10, 0),
Vector3.new(10, -10, 0),
Vector3.new(-10, -10, 0)
}
-- 將路徑應用於裝飾並關閉它(連接起始和結束點)
wireframe:AddPath(pathArray, true)
多彩的框架
local wireframe = script.Parent
wireframe.Color3 = Color3.fromRGB(255, 0, 0) -- 將下一行設為紅色
wireframe:AddLine(Vector3.new(-10, 0, 0), Vector3.new(10, 0, 0))
wireframe.Color3 = Color3.fromRGB(0, 255, 0) -- 將下一行設為綠色
wireframe:AddLine(Vector3.new(0, -10, 0), Vector3.new(0, 10, 0))
wireframe.Color3 = Color3.fromRGB(0, 0, 255) -- 將下一行設為藍色
wireframe:AddLine(Vector3.new(0, 0, -10), Vector3.new(0, 0, 10))

API 參考
屬性
Scale
平行讀取
功能: Basic, UI
WireframeHandleAdornment.Scale:Vector3

Thickness
平行讀取
功能: Basic, UI
WireframeHandleAdornment.Thickness:number

方法
AddLine
功能: Basic, UI
WireframeHandleAdornment:AddLine(
from:Vector3, to:Vector3
):()
參數
from:Vector3
返回
()
範例程式碼
多彩的框架
local wireframe = script.Parent
wireframe.Color3 = Color3.fromRGB(255, 0, 0) -- 將下一行設為紅色
wireframe:AddLine(Vector3.new(-10, 0, 0), Vector3.new(10, 0, 0))
wireframe.Color3 = Color3.fromRGB(0, 255, 0) -- 將下一行設為綠色
wireframe:AddLine(Vector3.new(0, -10, 0), Vector3.new(0, 10, 0))
wireframe.Color3 = Color3.fromRGB(0, 0, 255) -- 將下一行設為藍色
wireframe:AddLine(Vector3.new(0, 0, -10), Vector3.new(0, 0, 10))

AddLines
功能: Basic, UI
WireframeHandleAdornment:AddLines(points:{any}):()
參數
points:{any}
返回
()
範例程式碼
來自陣列的線框
local wireframe = script.Parent
local linesArray = {
Vector3.new(-10, 0, 0), -- 第一條線的起點
Vector3.new(10, 0, 0), -- 第一條線的終點
Vector3.new(0, -10, 0), -- 第二條線的起點
Vector3.new(0, 10, 0), -- 第二條線的終點
Vector3.new(0, 0, -10), -- 第三條線的起點
Vector3.new(0, 0, 10) -- 第三條線的終點
}
-- 將路徑應用於裝飾物
wireframe:AddLines(linesArray)

AddPath
功能: Basic, UI
WireframeHandleAdornment:AddPath(
points:{any}, loop:boolean
):()
參數
points:{any}
loop:boolean
返回
()
範例程式碼
基本路徑框架
local wireframe = script.Parent
-- 在方形排列中聲明四個點
local pathArray = {
Vector3.new(-10, 10, 0),
Vector3.new(10, 10, 0),
Vector3.new(10, -10, 0),
Vector3.new(-10, -10, 0)
}
-- 將路徑應用於裝飾並關閉它(連接起始和結束點)
wireframe:AddPath(pathArray, true)

AddText
功能: Basic, UI
WireframeHandleAdornment:AddText(
point:Vector3, text:string, size:number
):()
參數
point:Vector3
text:string
size:number
預設值:12
返回
()

Clear
功能: Basic, UI
WireframeHandleAdornment:Clear():()
返回
()

©2026 Roblox Corporation、Roblox、Roblox 標誌及 Powering Imagination 是我們在美國及其他國家地區的部分註冊與未註冊商標。