Ghi chú phát hành
Học
Lớp công cụ
ChatInputBarConfiguration
Không Thể Tạo

*Nội dung này được dịch bằng AI (Beta) và có thể có lỗi. Để xem trang này bằng tiếng Anh, hãy nhấp vào đây.


Mẫu mã
Lấy Tổng Khung Giao Diện Chat
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
-- Tính toán hợp nhất của cả hai hình chữ nhật để lấy tổng khung giao diện chat.
-- Các giá trị báo cáo không bao gồm các viền trang trí ở trên
-- và dưới của cửa sổ chat.
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
-- Đợi giao diện chat khởi tạo và báo cáo các giá trị tuyệt đối
task.wait(2)
local position, size = getTotalChatBounds()
print("Tổng vị trí giao diện chat:", position)
print("Tổng kích thước giao diện chat:", size)
-- Đặt một khung bán trong suốt để xác minh trực quan các khung
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

Tài Liệu Tham Khảo API
Thuộc Tính
AbsolutePosition
Chỉ Đọc
Không Sao Chép
Các khả năng: Chat
ChatInputBarConfiguration.AbsolutePosition:Vector2

AbsoluteSize
Chỉ Đọc
Không Sao Chép
Các khả năng: Chat
ChatInputBarConfiguration.AbsoluteSize:Vector2

AutocompleteEnabled
Đọc Song Song
Các khả năng: Chat
ChatInputBarConfiguration.AutocompleteEnabled:boolean

BackgroundColor3
Đọc Song Song
Các khả năng: Chat
ChatInputBarConfiguration.BackgroundColor3:Color3

BackgroundTransparency
Đọc Song Song
Các khả năng: Chat
ChatInputBarConfiguration.BackgroundTransparency:number

Enabled
Đọc Song Song
Các khả năng: Chat
ChatInputBarConfiguration.Enabled:boolean

FontFace
Đọc Song Song
Các khả năng: Chat
ChatInputBarConfiguration.FontFace:Font

IsFocused
Chỉ Đọc
Không Sao Chép
Các khả năng: Chat
ChatInputBarConfiguration.IsFocused:boolean
Mẫu mã
Bong bóng chỉ thị gõ
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()
-- Thiết lập 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
-- Thêm một UICorner vào TextLabel để có các cạnh bo tròn
local uiCorner = Instance.new("UICorner")
uiCorner.CornerRadius = UDim.new(0, 12)
uiCorner.Parent = textLabel
-- Thiết lập 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()
-- Kích hoạt chỉ thị gõ khi thanh nhập được tập trung và vô hiệu hóa nếu không
typingIndicatorBillboard.Enabled = ChatInputBarConfiguration.IsFocused
end)

KeyboardKeyCode
Đọc Song Song
Các khả năng: Chat
ChatInputBarConfiguration.KeyboardKeyCode:Enum.KeyCode

PlaceholderColor3
Đọc Song Song
Các khả năng: Chat
ChatInputBarConfiguration.PlaceholderColor3:Color3

TargetTextChannel
Đọc Song Song
Các khả năng: Chat
ChatInputBarConfiguration.TargetTextChannel:TextChannel

TextBox
Đọc Song Song
Các khả năng: Chat
ChatInputBarConfiguration.TextBox:TextBox

TextColor3
Đọc Song Song
Các khả năng: Chat
ChatInputBarConfiguration.TextColor3:Color3

TextSize
Đọc Song Song
Các khả năng: Chat
ChatInputBarConfiguration.TextSize:number

TextStrokeColor3
Đọc Song Song
Các khả năng: Chat
ChatInputBarConfiguration.TextStrokeColor3:Color3

TextStrokeTransparency
Đọc Song Song
Các khả năng: Chat
ChatInputBarConfiguration.TextStrokeTransparency:number

©2026 Roblox Corporation. Roblox, logo Roblox và Powering Imagination là các nhãn hiệu đã đăng ký và chưa đăng ký của chúng tôi tại Hoa Kỳ và các quốc gia khác.