Apprendre
Classe de moteur
ChatInputBarConfiguration
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
ChatInputBarConfiguration.AbsolutePosition:Vector2

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

AutocompleteEnabled
Lecture parallèle
Capacités : Chat
ChatInputBarConfiguration.AutocompleteEnabled:boolean

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

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

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

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

IsFocused
Lecture uniquement
Non répliqué
Capacités : Chat
ChatInputBarConfiguration.IsFocused:boolean
Échantillons de code
Indicateur de saisie en cours
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()
-- Configurer le 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
-- Ajouter un UICorner au TextLabel pour avoir des coins arrondis
local uiCorner = Instance.new("UICorner")
uiCorner.CornerRadius = UDim.new(0, 12)
uiCorner.Parent = textLabel
-- Configurer le 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()
-- Activer l'indicateur de saisie lorsque la barre d'entrée est focalisée et désactiver autrement
typingIndicatorBillboard.Enabled = ChatInputBarConfiguration.IsFocused
end)

KeyboardKeyCode
Lecture parallèle
Capacités : Chat
ChatInputBarConfiguration.KeyboardKeyCode:Enum.KeyCode

PlaceholderColor3
Lecture parallèle
Capacités : Chat
ChatInputBarConfiguration.PlaceholderColor3:Color3

TargetTextChannel
Lecture parallèle
Capacités : Chat
ChatInputBarConfiguration.TargetTextChannel:TextChannel

TextBox
Lecture parallèle
Capacités : Chat
ChatInputBarConfiguration.TextBox:TextBox

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

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

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

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

©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.