学习
引擎类
WireframeHandleAdornment

*此内容使用人工智能(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 是我们在美国及其他国家或地区的注册与未注册商标。