Apprendre
Classe de moteur
ChatWindowConfiguration
Création impossible

*Ce contenu est traduit en utilisant l'IA (Beta) et peut contenir des erreurs. Pour consulter cette page en anglais, clique ici.


Échantillons de code
Obtenir les limites totales de l'interface utilisateur du 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
-- Calculez l'union des deux rectangles pour obtenir les limites totales de l'interface utilisateur du chat.
-- Les valeurs signalées n'incluent pas le biseautage décoratif en haut
-- et en bas de la fenêtre 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
-- Attendre que l'interface utilisateur du chat s'initialise et signale les valeurs absolues
task.wait(2)
local position, size = getTotalChatBounds()
print("Position totale de l'interface utilisateur du chat :", position)
print("Taille totale de l'interface utilisateur du chat :", size)
-- Superposer un cadre semi-transparent pour vérifier visuellement les limites
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

Référence API
Propriétés
AbsolutePosition
Lecture uniquement
Non répliqué
Capacités : Chat
ChatWindowConfiguration.AbsolutePosition:Vector2

AbsoluteSize
Lecture uniquement
Non répliqué
Capacités : Chat
ChatWindowConfiguration.AbsoluteSize:Vector2

BackgroundColor3
Lecture parallèle
Capacités : Chat
ChatWindowConfiguration.BackgroundColor3:Color3

BackgroundTransparency
Lecture parallèle
Capacités : Chat
ChatWindowConfiguration.BackgroundTransparency:number

Enabled
Lecture parallèle
Capacités : Chat
ChatWindowConfiguration.Enabled:boolean

FontFace
Lecture parallèle
Capacités : Chat
ChatWindowConfiguration.FontFace:Font

HeightScale
Lecture parallèle
Capacités : Chat
ChatWindowConfiguration.HeightScale:number

HorizontalAlignment
Capacités : Chat
ChatWindowConfiguration.HorizontalAlignment:Enum.HorizontalAlignment

TextColor3
Lecture parallèle
Capacités : Chat
ChatWindowConfiguration.TextColor3:Color3

TextSize
Lecture parallèle
Capacités : Chat
ChatWindowConfiguration.TextSize:number

TextStrokeColor3
Lecture parallèle
Capacités : Chat
ChatWindowConfiguration.TextStrokeColor3:Color3

TextStrokeTransparency
Lecture parallèle
Capacités : Chat
ChatWindowConfiguration.TextStrokeTransparency:number

VerticalAlignment
Capacités : Chat
ChatWindowConfiguration.VerticalAlignment:Enum.VerticalAlignment

WidthScale
Lecture parallèle
Capacités : Chat
ChatWindowConfiguration.WidthScale:number

Méthodes
DeriveNewMessageProperties
Capacités : Chat
ChatWindowConfiguration:DeriveNewMessageProperties():ChatWindowMessageProperties
Échantillons de code
CanUsersDirectChatAsync
local TextChatService = game:GetService("TextChatService")
local directChatParticipants = TextChatService:CanUsersDirectChatAsync(userId1, { userId2 })
-- Vérifiez les participants éligibles
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("Impossible de créer TextChannel. Pas assez d'utilisateurs éligibles.")
return nil

©2026 Société Roblox. Roblox, le logo Roblox et Powering Imagination font partie de nos marques déposées aux États-Unis et dans d'autres pays.