Meer informatie
Engine-klasse
ChatWindowConfiguration
Niet maakbaar

*Deze inhoud is vertaald met behulp van AI (bèta) en kan fouten bevatten. Klik hier om deze pagina in het Engels te bekijken.


Codevoorbeelden
Krijg Totale Chat UI Grenzen
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
-- Bereken de unie van beide rechthoeken om totale chat UI grenzen te krijgen.
-- De gerapporteerde waarden omvatten niet de decoratieve afschuin aan de boven
-- en onderrand van het chatvenster.
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
-- Wacht tot de chat UI is geïnitialiseerd en rapporteer absolute waarden
task.wait(2)
local position, size = getTotalChatBounds()
print("Totale chat UI positie:", position)
print("Totale chat UI grootte:", size)
-- Overlay een semi-transparante frame om de grenzen visueel te verifiëren
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

API-referentie
Eigenschappen
AbsolutePosition
Alleen-lezen
Niet gerepliceerd
Mogelijkheden: Chat
ChatWindowConfiguration.AbsolutePosition:Vector2

AbsoluteSize
Alleen-lezen
Niet gerepliceerd
Mogelijkheden: Chat
ChatWindowConfiguration.AbsoluteSize:Vector2

BackgroundColor3
Parallel lezen
Mogelijkheden: Chat
ChatWindowConfiguration.BackgroundColor3:Color3

BackgroundTransparency
Parallel lezen
Mogelijkheden: Chat
ChatWindowConfiguration.BackgroundTransparency:number

Enabled
Parallel lezen
Mogelijkheden: Chat
ChatWindowConfiguration.Enabled:boolean

FontFace
Parallel lezen
Mogelijkheden: Chat
ChatWindowConfiguration.FontFace:Font

HeightScale
Parallel lezen
Mogelijkheden: Chat
ChatWindowConfiguration.HeightScale:number

HorizontalAlignment
Mogelijkheden: Chat
ChatWindowConfiguration.HorizontalAlignment:Enum.HorizontalAlignment

TextColor3
Parallel lezen
Mogelijkheden: Chat
ChatWindowConfiguration.TextColor3:Color3

TextSize
Parallel lezen
Mogelijkheden: Chat
ChatWindowConfiguration.TextSize:number

TextStrokeColor3
Parallel lezen
Mogelijkheden: Chat
ChatWindowConfiguration.TextStrokeColor3:Color3

TextStrokeTransparency
Parallel lezen
Mogelijkheden: Chat
ChatWindowConfiguration.TextStrokeTransparency:number

VerticalAlignment
Mogelijkheden: Chat
ChatWindowConfiguration.VerticalAlignment:Enum.VerticalAlignment

WidthScale
Parallel lezen
Mogelijkheden: Chat
ChatWindowConfiguration.WidthScale:number

Methoden
DeriveNewMessageProperties
Mogelijkheden: Chat
ChatWindowConfiguration:DeriveNewMessageProperties():ChatWindowMessageProperties
Codevoorbeelden
CanUsersDirectChatAsync
local TextChatService = game:GetService("TextChatService")
local directChatParticipants = TextChatService:CanUsersDirectChatAsync(userId1, { userId2 })
-- Controleer op in aanmerking komende deelnemers
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("Kon geen TextChannel maken. Niet genoeg in aanmerking komende gebruikers.")
return nil
Afgeleide Nieuwe Bericht Eigenschappen
local TextChatService = game:GetService("TextChatService")
local ChatWindowConfiguration = TextChatService.ChatWindowConfiguration
TextChatService.OnChatWindowAdded = function(textChatMessage)
local properties = ChatWindowConfiguration:DeriveNewMessageProperties()
if textChatMessage.Metadata == "Belangrijk" then
properties.TextColor3 = Color3.fromRGB(255, 0, 0)
end
return properties
end

©2026 Roblox Corporation. Roblox, het Roblox-logo en Powering Imagination behoren tot onze geregistreerde en niet-geregistreerde handelsmerken in de VS en andere landen.