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

*เนื้อหานี้แปลโดยใช้ 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
ChatInputBarConfiguration.AbsolutePosition:Vector2

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

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

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

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

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

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

IsFocused
อ่านอย่างเดียว
ไม่ซ้ำ
ความสามารถ: Chat
ChatInputBarConfiguration.IsFocused:boolean
ตัวอย่างโค้ด
ฟองอากาศตัวชี้การพิมพ์
local Players = game:GetService("Players")
local TextChatService = game:GetService("TextChatService")
local ChatInputBarConfiguration = TextChatService:FindFirstChildOfClass("ChatInputBarConfiguration")
local BubbleChatConfiguration = TextChatService:FindFirstChildOfClass("BubbleChatConfiguration")
local LocalPlayer = Players.LocalPlayer
local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
-- ตั้งค่า TextLabel
local textLabel = Instance.new("TextLabel")
textLabel.Size = UDim2.fromScale(1, 1)
textLabel.Text = ". . ."
textLabel.BackgroundColor3 = BubbleChatConfiguration.BackgroundColor3
textLabel.BorderColor3 = BubbleChatConfiguration.BackgroundColor3
textLabel.BackgroundTransparency = BubbleChatConfiguration.BackgroundTransparency
textLabel.TextColor3 = BubbleChatConfiguration.TextColor3
textLabel.FontFace = BubbleChatConfiguration.FontFace
textLabel.TextSize = BubbleChatConfiguration.TextSize
-- เพิ่ม UICorner ให้กับ TextLabel เพื่อให้มีมุมโค้ง
local uiCorner = Instance.new("UICorner")
uiCorner.CornerRadius = UDim.new(0, 12)
uiCorner.Parent = textLabel
-- ตั้งค่า Billboard
local typingIndicatorBillboard = Instance.new("BillboardGui")
typingIndicatorBillboard.Enabled = false
typingIndicatorBillboard.Size = UDim2.fromScale(1, 1)
typingIndicatorBillboard.StudsOffsetWorldSpace = Vector3.new(-0, 4, 0)
typingIndicatorBillboard.Adornee = Character
textLabel.Parent = typingIndicatorBillboard
typingIndicatorBillboard.Parent = LocalPlayer:FindFirstChildOfClass("PlayerGui")
ChatInputBarConfiguration:GetPropertyChangedSignal("IsFocused"):Connect(function()
-- เปิดตัวชี้การพิมพ์เมื่อแถบการป้อนข้อมูลมีโฟกัสและปิดในทางกลับกัน
typingIndicatorBillboard.Enabled = ChatInputBarConfiguration.IsFocused
end)

KeyboardKeyCode
อ่านพร้อมๆ กัน
ความสามารถ: Chat
ChatInputBarConfiguration.KeyboardKeyCode:Enum.KeyCode

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

TargetTextChannel
อ่านพร้อมๆ กัน
ความสามารถ: Chat
ChatInputBarConfiguration.TargetTextChannel:TextChannel

TextBox
อ่านพร้อมๆ กัน
ความสามารถ: Chat
ChatInputBarConfiguration.TextBox:TextBox

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

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

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

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

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