เรียนรู้
Engine Class
ChatWindowConfiguration
ไม่สามารถสร้าง

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


สรุป
สมาชิกที่ได้รับทอด
ตัวอย่างโค้ด
รับขอบ UI แชททั้งหมด
local Players = game:GetService("Players")
local TextChatService = game:GetService("TextChatService")
local player = Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
local windowConfig = TextChatService.ChatWindowConfiguration
local inputBarConfig = TextChatService.ChatInputBarConfiguration
local function getTotalChatBounds()
local windowPos = windowConfig.AbsolutePosition
local windowSize = windowConfig.AbsoluteSize
local inputPos = inputBarConfig.AbsolutePosition
local inputSize = inputBarConfig.AbsoluteSize
-- คำนวณการรวมของทั้งสองสี่เหลี่ยมเพื่อให้ได้ขอบ UI แชททั้งหมด
-- ค่าที่รายงานไม่รวม bevel ตกแต่งที่ด้านบน
-- และด้านล่างของหน้าต่างแชท
local topLeft = Vector2.new(
math.min(windowPos.X, inputPos.X),
math.min(windowPos.Y, inputPos.Y)
)
local bottomRight = Vector2.new(
math.max(windowPos.X + windowSize.X, inputPos.X + inputSize.X),
math.max(windowPos.Y + windowSize.Y, inputPos.Y + inputSize.Y)
)
return topLeft, bottomRight - topLeft
end
-- รอให้ UI แชทเริ่มต้นและรายงานค่าที่แท้จริง
task.wait(2)
local position, size = getTotalChatBounds()
print("ตำแหน่ง UI แชททั้งหมด:", position)
print("ขนาด UI แชททั้งหมด:", size)
-- Overlay เฟรมโปร่งแสงเพื่อยืนยันขอบทางสายตา
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "ChatBoundsDebug"
screenGui.DisplayOrder = 100
screenGui.Parent = playerGui
local frame = Instance.new("Frame")
frame.Position = UDim2.fromOffset(position.X, position.Y)
frame.Size = UDim2.fromOffset(size.X, size.Y)
frame.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
frame.BackgroundTransparency = 0.5
frame.BorderSizePixel = 2
frame.BorderColor3 = Color3.fromRGB(255, 0, 0)
frame.Parent = screenGui

เอกสารอ้างอิงเกี่ยวกับ API
คุณสมบัติ
AbsolutePosition
อ่านอย่างเดียว
ไม่ซ้ำ
ความสามารถ: Chat
ChatWindowConfiguration.AbsolutePosition:Vector2

AbsoluteSize
อ่านอย่างเดียว
ไม่ซ้ำ
ความสามารถ: Chat
ChatWindowConfiguration.AbsoluteSize:Vector2

BackgroundColor3
อ่านพร้อมๆ กัน
ความสามารถ: Chat
ChatWindowConfiguration.BackgroundColor3:Color3

BackgroundTransparency
อ่านพร้อมๆ กัน
ความสามารถ: Chat
ChatWindowConfiguration.BackgroundTransparency:number

Enabled
อ่านพร้อมๆ กัน
ความสามารถ: Chat
ChatWindowConfiguration.Enabled:boolean

FontFace
อ่านพร้อมๆ กัน
ความสามารถ: Chat
ChatWindowConfiguration.FontFace:Font

HeightScale
อ่านพร้อมๆ กัน
ความสามารถ: Chat
ChatWindowConfiguration.HeightScale:number

HorizontalAlignment
ความสามารถ: Chat
ChatWindowConfiguration.HorizontalAlignment:Enum.HorizontalAlignment

TextColor3
อ่านพร้อมๆ กัน
ความสามารถ: Chat
ChatWindowConfiguration.TextColor3:Color3

TextSize
อ่านพร้อมๆ กัน
ความสามารถ: Chat
ChatWindowConfiguration.TextSize:number

TextStrokeColor3
อ่านพร้อมๆ กัน
ความสามารถ: Chat
ChatWindowConfiguration.TextStrokeColor3:Color3

TextStrokeTransparency
อ่านพร้อมๆ กัน
ความสามารถ: Chat
ChatWindowConfiguration.TextStrokeTransparency:number

VerticalAlignment
ความสามารถ: Chat
ChatWindowConfiguration.VerticalAlignment:Enum.VerticalAlignment

WidthScale
อ่านพร้อมๆ กัน
ความสามารถ: Chat
ChatWindowConfiguration.WidthScale:number

วิธีการ
DeriveNewMessageProperties
ความสามารถ: Chat
ChatWindowConfiguration:DeriveNewMessageProperties():ChatWindowMessageProperties
ส่งค่ากลับ
ตัวอย่างโค้ด
CanUsersDirectChatAsync
local TextChatService = game:GetService("TextChatService")
local directChatParticipants = TextChatService:CanUsersDirectChatAsync(userId1, { userId2 })
-- ตรวจสอบผู้เข้าร่วมที่มีสิทธิ์
if #directChatParticipants > 0 then
local directChannel = Instance.new("TextChannel")
directChannel.Parent = TextChatService
for _, participant in directChatParticipants do
directChannel:AddUserAsync(participant)
end
return directChannel
end
warn("ไม่สามารถสร้าง TextChannel ได้ ผู้ใช้ที่มีสิทธิ์ไม่เพียงพอ.")
return nil

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