ChatInputBarConfiguration
*이 콘텐츠는 AI(베타)를 사용해 번역되었으며, 오류가 있을 수 있습니다. 이 페이지를 영어로 보려면 여기를 클릭하세요.
기본 텍스트 채팅 입력란의 속성을 구성합니다. 부모는 TextChatService입니다.
요약
속성
기본 채팅 입력란의 실제 화면 위치를 픽셀로 표시합니다.
기본 채팅 입력란의 실제 화면 크기(픽셀)입니다.
채팅 입력 바에 대한 자동 완성 활성화 여부.
기본 채팅 입력란의 배경색.
기본 채팅 입력란의 배경 투명도.
기본 채팅 입력 바를 표시할지 여부.
기본 채팅 입력란에서 텍스트를 렌더링하는 데 사용되는 글꼴.
기본 채팅 입력 바가 포커스되었는지 여부.
추가 키 사용자는 기본 채팅 입력란에 초점을 맞추도록 누르면 됩니다.
기본 채팅 입력란의 플레이스홀더 텍스트 색상. Color of the text of the placeholder text in the default chat input bar.
대상 참조 TextChannel .
사용자를 대신하여 메시지를 보내는 지정된 TextBox 인스턴스에 대한 참조.
기본 채팅 입력란의 텍스트 색상.
기본 채팅 입력란의 텍스트 크기.
기본 채팅 입력란의 텍스트에 대한 텍스트 스트로크 색상.
기본 채팅 입력란의 텍스트에 대한 텍스트 스트로크의 투명도.
속성
BackgroundTransparency
기본 채팅 입력 바의 배경 투명도가 숫자로 0에서 1 사이입니다.이 값은 사용자의 GuiService.PreferredTransparency와 곱해서 채팅 입력 바에서 사용되는 효과적인 배경 투명도를 생성하며, 여기에 설정된 값보다 불투명할 수 있습니다.기본값은 0.2 입니다.
IsFocused
기본 채팅 입력란이 포커스 되었는지 여부를 나타냅니다.입력란의 초점 상태 변경에 응답하는 콜백 함수를 구현할 수 있도록 속성 변경 이벤트를 발사하는 데 유용합니다.
코드 샘플
The code below includes a simple way to create a typing indicator bubble above a user's avatar when the user is typing. Paste into a LocalScript.
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()
-- Set up 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
-- Parent a UICorner to the TextLabel to have rounded corners
local uiCorner = Instance.new("UICorner")
uiCorner.CornerRadius = UDim.new(0, 12)
uiCorner.Parent = textLabel
-- Set up 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()
-- Enable the typing indicator when the input bar is focused and disable otherwise
typingIndicatorBillboard.Enabled = ChatInputBarConfiguration.IsFocused
end)
KeyboardKeyCode
추가 키 사용자는 기본 채팅 입력란에 초점을 맞추도록 누르면 됩니다./ 키에 더해 초점을 맞추기 위한 추가 핫키를 원할 때 유용합니다.
TextBox
사용자를 대신하여 메시지를 보내는 지정된 TextBox 인스턴스에 대한 참조.모습, 위치 및 레이아웃을 자유롭게 조작하여 사용자 지정 채팅 입력란 UI를 경험에 통합할 수 있습니다.이 속성을 사용자 지정 TextBox 로 설정하기로 선택하면 다음 행동에 대해 코드를 작성할 필요가 없습니다.
- 사용자가 메시지를 입력하고 Enum.KeyCode.Return 를 누르면 메시지가 ChatInputBarConfiguration.TargetTextChannel 에 전송됩니다.
- 메시지가 전송되면 TextBox.Text가 자동으로 지우다.
보안상 일부 제한이 적용되어 프로모트되면 TextBox 에서 ChatInputBarConfiguration.TextBox 로 Luau 코드가 수행할 수 없습니다.
- TextBox.Text 속성을 변경하십시오.
- TextBox:CaptureFocus() 또는 TextBox:ReleaseFocus() 메서드를 사용하십시오.