Pelajari
Kelas Engine
ChatWindowConfiguration
Tidak Dapat Dibuat

*Konten ini diterjemahkan menggunakan AI (Beta) dan mungkin mengandung kesalahan. Untuk melihat halaman ini dalam bahasa Inggris, klik di sini.


Contoh Kode
Dapatkan Total Batas Antarmuka Obrolan
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
-- Hitung gabungan dari kedua persegi panjang untuk mendapatkan total batas antarmuka obrolan.
-- Nilai yang dilaporkan tidak termasuk bevel dekoratif di bagian atas
-- dan bawah dari jendela obrolan.
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
-- Tunggu antarmuka obrolan untuk diinisialisasi dan melaporkan nilai absolut
task.wait(2)
local position, size = getTotalChatBounds()
print("Posisi total antarmuka obrolan:", position)
print("Ukuran total antarmuka obrolan:", size)
-- Overlay bingkai semi-transparan untuk memverifikasi batas secara visual
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

Referensi API
Properti
AbsolutePosition
Hanya Baca
Tidak Direplikasi
Kemampuan: Chat
ChatWindowConfiguration.AbsolutePosition:Vector2

AbsoluteSize
Hanya Baca
Tidak Direplikasi
Kemampuan: Chat
ChatWindowConfiguration.AbsoluteSize:Vector2

BackgroundColor3
Baca Paralel
Kemampuan: Chat
ChatWindowConfiguration.BackgroundColor3:Color3

BackgroundTransparency
Baca Paralel
Kemampuan: Chat
ChatWindowConfiguration.BackgroundTransparency:number

Enabled
Baca Paralel
Kemampuan: Chat
ChatWindowConfiguration.Enabled:boolean

FontFace
Baca Paralel
Kemampuan: Chat
ChatWindowConfiguration.FontFace:Font

HeightScale
Baca Paralel
Kemampuan: Chat
ChatWindowConfiguration.HeightScale:number

HorizontalAlignment
Kemampuan: Chat
ChatWindowConfiguration.HorizontalAlignment:Enum.HorizontalAlignment

TextColor3
Baca Paralel
Kemampuan: Chat
ChatWindowConfiguration.TextColor3:Color3

TextSize
Baca Paralel
Kemampuan: Chat
ChatWindowConfiguration.TextSize:number

TextStrokeColor3
Baca Paralel
Kemampuan: Chat
ChatWindowConfiguration.TextStrokeColor3:Color3

TextStrokeTransparency
Baca Paralel
Kemampuan: Chat
ChatWindowConfiguration.TextStrokeTransparency:number

VerticalAlignment
Kemampuan: Chat
ChatWindowConfiguration.VerticalAlignment:Enum.VerticalAlignment

WidthScale
Baca Paralel
Kemampuan: Chat
ChatWindowConfiguration.WidthScale:number

Metode
DeriveNewMessageProperties
Kemampuan: Chat
ChatWindowConfiguration:DeriveNewMessageProperties():ChatWindowMessageProperties
Contoh Kode
CanUsersDirectChatAsync
local TextChatService = game:GetService("TextChatService")
local directChatParticipants = TextChatService:CanUsersDirectChatAsync(userId1, { userId2 })
-- Periksa peserta yang memenuhi syarat
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("Tidak dapat membuat TextChannel. Pengguna yang memenuhi syarat tidak cukup.")
return nil

©2026 Roblox Corporation. Roblox, logo Roblox, dan Powering Imagination termasuk dalam merek dagang kami yang terdaftar dan tidak terdaftar di AS dan negara lainnya.