Informacje o wersji
Edukacja
Klasa silnika
ChatInputBarConfiguration
Brak możliwości tworzenia

*Ta zawartość została przetłumaczona przy użyciu narzędzi AI (w wersji beta) i może zawierać błędy. Aby wyświetlić tę stronę w języku angielskim, kliknij tutaj.


Przykłady kodu
Uzyskaj całkowite wymiary interfejsu czatu
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
-- Oblicz złączenie obu prostokątów, aby uzyskać całkowite wymiary interfejsu czatu.
-- Zgłoszone wartości nie obejmują dekoracyjnego fazowania na górze
-- i dolnych krawędziach okna czatu.
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
-- Czekaj na zainicjowanie interfejsu czatu i zgłoszenie wartości bezwzględnych
task.wait(2)
local position, size = getTotalChatBounds()
print("Całkowita pozycja interfejsu czatu:", position)
print("Całkowity rozmiar interfejsu czatu:", size)
-- Nałóż półprzezroczystą ramkę, aby wizualnie zweryfikować wymiary
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

Materiały referencyjne dotyczące interfejsów API
Właściwości
AbsolutePosition
Tylko do odczytu
Bez replikacji
Możliwości: Chat
ChatInputBarConfiguration.AbsolutePosition:Vector2

AbsoluteSize
Tylko do odczytu
Bez replikacji
Możliwości: Chat
ChatInputBarConfiguration.AbsoluteSize:Vector2

AutocompleteEnabled
Odczyt równoległy
Możliwości: Chat
ChatInputBarConfiguration.AutocompleteEnabled:boolean

BackgroundColor3
Odczyt równoległy
Możliwości: Chat
ChatInputBarConfiguration.BackgroundColor3:Color3

BackgroundTransparency
Odczyt równoległy
Możliwości: Chat
ChatInputBarConfiguration.BackgroundTransparency:number

Enabled
Odczyt równoległy
Możliwości: Chat
ChatInputBarConfiguration.Enabled:boolean

FontFace
Odczyt równoległy
Możliwości: Chat
ChatInputBarConfiguration.FontFace:Font

IsFocused
Tylko do odczytu
Bez replikacji
Możliwości: Chat
ChatInputBarConfiguration.IsFocused:boolean
Przykłady kodu
Bąbelek wskaźnika pisania
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()
-- Ustaw 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
-- Dodaj UICorner do TextLabel, aby uzyskać zaokrąglone rogi
local uiCorner = Instance.new("UICorner")
uiCorner.CornerRadius = UDim.new(0, 12)
uiCorner.Parent = textLabel
-- Ustaw 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()
-- Włącz wskaźnik pisania, gdy pasek wejściowy jest skoncentrowany, i wyłącz w przeciwnym razie
typingIndicatorBillboard.Enabled = ChatInputBarConfiguration.IsFocused
end)

KeyboardKeyCode
Odczyt równoległy
Możliwości: Chat
ChatInputBarConfiguration.KeyboardKeyCode:Enum.KeyCode

PlaceholderColor3
Odczyt równoległy
Możliwości: Chat
ChatInputBarConfiguration.PlaceholderColor3:Color3

TargetTextChannel
Odczyt równoległy
Możliwości: Chat
ChatInputBarConfiguration.TargetTextChannel:TextChannel

TextBox
Odczyt równoległy
Możliwości: Chat
ChatInputBarConfiguration.TextBox:TextBox

TextColor3
Odczyt równoległy
Możliwości: Chat
ChatInputBarConfiguration.TextColor3:Color3

TextSize
Odczyt równoległy
Możliwości: Chat
ChatInputBarConfiguration.TextSize:number

TextStrokeColor3
Odczyt równoległy
Możliwości: Chat
ChatInputBarConfiguration.TextStrokeColor3:Color3

TextStrokeTransparency
Odczyt równoległy
Możliwości: Chat
ChatInputBarConfiguration.TextStrokeTransparency:number

©2026 Roblox Corporation. Nazwa Roblox, logo Roblox oraz hasło „Powering Imagination” należą do naszych zarejestrowanych i niezarejestrowanych znaków towarowych na terenie Stanów Zjednoczonych oraz w innych krajach.