Aprender
Clase de motor
ChatWindowConfiguration
No creable

*Este contenido se traduce usando la IA (Beta) y puede contener errores. Para ver esta página en inglés, haz clic en aquí.


Muestras de código
Obtener los límites totales de la interfaz de 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
-- Calcula la unión de ambos rectángulos para obtener los límites totales de la interfaz de chat.
-- Los valores reportados no incluyen el bisel decorativo en la parte superior
-- y en los bordes inferiores de la ventana de 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
-- Espere a que la interfaz de chat se inicialice y reporte valores absolutos
task.wait(2)
local position, size = getTotalChatBounds()
print("Posición total de la interfaz de chat:", position)
print("Tamaño total de la interfaz de chat:", size)
-- Superpón un marco semitransparente para verificar visualmente los límites
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

Referencia API
Propiedades
AbsolutePosition
Solo lectura
No replicado
Capacidades: Chat
ChatWindowConfiguration.AbsolutePosition:Vector2

AbsoluteSize
Solo lectura
No replicado
Capacidades: Chat
ChatWindowConfiguration.AbsoluteSize:Vector2

BackgroundColor3
Leer paralelo
Capacidades: Chat
ChatWindowConfiguration.BackgroundColor3:Color3

BackgroundTransparency
Leer paralelo
Capacidades: Chat
ChatWindowConfiguration.BackgroundTransparency:number

Enabled
Leer paralelo
Capacidades: Chat
ChatWindowConfiguration.Enabled:boolean

FontFace
Leer paralelo
Capacidades: Chat
ChatWindowConfiguration.FontFace:Font

HeightScale
Leer paralelo
Capacidades: Chat
ChatWindowConfiguration.HeightScale:number

HorizontalAlignment
Capacidades: Chat
ChatWindowConfiguration.HorizontalAlignment:Enum.HorizontalAlignment

TextColor3
Leer paralelo
Capacidades: Chat
ChatWindowConfiguration.TextColor3:Color3

TextSize
Leer paralelo
Capacidades: Chat
ChatWindowConfiguration.TextSize:number

TextStrokeColor3
Leer paralelo
Capacidades: Chat
ChatWindowConfiguration.TextStrokeColor3:Color3

TextStrokeTransparency
Leer paralelo
Capacidades: Chat
ChatWindowConfiguration.TextStrokeTransparency:number

VerticalAlignment
Capacidades: Chat
ChatWindowConfiguration.VerticalAlignment:Enum.VerticalAlignment

WidthScale
Leer paralelo
Capacidades: Chat
ChatWindowConfiguration.WidthScale:number

Métodos
DeriveNewMessageProperties
Capacidades: Chat
ChatWindowConfiguration:DeriveNewMessageProperties():ChatWindowMessageProperties
Muestras de código
CanUsersDirectChatAsync
local TextChatService = game:GetService("TextChatService")
local directChatParticipants = TextChatService:CanUsersDirectChatAsync(userId1, { userId2 })
-- Verificar si hay participantes elegibles
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("No se pudo crear TextChannel. No hay suficientes usuarios elegibles.")
return nil

©2026 Roblox Corporation. Roblox, el logotipo de Roblox y "Powering Imagination" son algunas de nuestras marcas registradas y no registradas en los Estados Unidos y otros países.