Aprenda
Classe do mecanismo
ChatWindowConfiguration
Não criável

*Este conteúdo é traduzido por IA (Beta) e pode conter erros. Para ver a página em inglês, clique aqui.


Amostras de código
Obter Limites Totais da UI do 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
-- Compute the union of both rectangles to get total chat UI bounds.
-- Os valores reportados não incluem o chanfro decorativo na parte superior
-- e nas bordas inferiores da janela do 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
-- Wait for chat UI to initialize and report absolute values
task.wait(2)
local position, size = getTotalChatBounds()
print("Posição total da UI do chat:", position)
print("Tamanho total da UI do chat:", size)
-- Overlay a semi-transparent frame to visually verify the bounds
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

Referência API
Propriedades
AbsolutePosition
Somente leitura
Não replicado
Recursos: Chat
ChatWindowConfiguration.AbsolutePosition:Vector2

AbsoluteSize
Somente leitura
Não replicado
Recursos: Chat
ChatWindowConfiguration.AbsoluteSize:Vector2

BackgroundColor3
Ler Parallel
Recursos: Chat
ChatWindowConfiguration.BackgroundColor3:Color3

BackgroundTransparency
Ler Parallel
Recursos: Chat
ChatWindowConfiguration.BackgroundTransparency:number

Enabled
Ler Parallel
Recursos: Chat
ChatWindowConfiguration.Enabled:boolean

FontFace
Ler Parallel
Recursos: Chat
ChatWindowConfiguration.FontFace:Font

HeightScale
Ler Parallel
Recursos: Chat
ChatWindowConfiguration.HeightScale:number

HorizontalAlignment
Recursos: Chat
ChatWindowConfiguration.HorizontalAlignment:Enum.HorizontalAlignment

TextColor3
Ler Parallel
Recursos: Chat
ChatWindowConfiguration.TextColor3:Color3

TextSize
Ler Parallel
Recursos: Chat
ChatWindowConfiguration.TextSize:number

TextStrokeColor3
Ler Parallel
Recursos: Chat
ChatWindowConfiguration.TextStrokeColor3:Color3

TextStrokeTransparency
Ler Parallel
Recursos: Chat
ChatWindowConfiguration.TextStrokeTransparency:number

VerticalAlignment
Recursos: Chat
ChatWindowConfiguration.VerticalAlignment:Enum.VerticalAlignment

WidthScale
Ler Parallel
Recursos: Chat
ChatWindowConfiguration.WidthScale:number

Métodos
DeriveNewMessageProperties
Recursos: Chat
ChatWindowConfiguration:DeriveNewMessageProperties():ChatWindowMessageProperties
Amostras de código
PodeUsuariosConversarDiretamenteAsync
local TextChatService = game:GetService("TextChatService")
local directChatParticipants = TextChatService:CanUsersDirectChatAsync(userId1, { userId2 })
-- Verifique os participantes elegíveis
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("Não foi possível criar o TextChannel. Usuários elegíveis insuficientes.")
return nil

©2026 Roblox Corporation, Roblox, o logotipo Roblox e Powering Imagination estão entre nossas marcas registradas e não registradas nos EUA e em outros países.