From 8199ac8b47544f2861eab317e6e32a50f7b0bc79 Mon Sep 17 00:00:00 2001 From: "rbx-open-source-docs[bot]" <138828531+rbx-open-source-docs[bot]@users.noreply.github.com> Date: Thu, 3 Oct 2024 21:13:44 +0000 Subject: [PATCH] update Open Source Docs from Roblox internal teams --- .../in-experience-text-chat/Chat-NPC.jpg | 3 + .../in-experience-text-chat/Chat-System.jpg | 3 + .../in-experience-text-chat/Chat-Tag-VIP.jpg | 4 +- .../Chat-Window-Components.jpg | 3 + .../ChatInputBarConfiguration-Enabled.png | 3 - .../ChatWindowConfiguration-Enabled.png | 3 - .../Text-Custom-Command.mp4 | 4 +- .../TextChatCommand-SizeCommand.png | 3 - .../TextChatService-Configuration-Objects.png | 4 +- ...xtChatService-ChannelTabsConfiguration.png | 3 + ...tChatService-ChatInputBarConfiguration.png | 3 + ...extChatService-ChatWindowConfiguration.png | 3 + .../TextChatService-TextChatCommand.png | 3 + .../customizing-in-experience-text-chat.md | 345 ++++++++++++++---- content/en-us/chat/in-experience-text-chat.md | 90 +++-- content/en-us/chat/legacy/admin-commands.md | 2 +- content/en-us/chat/voice-chat.md | 2 +- .../classes/ChannelTabsConfiguration.yaml | 92 +++-- .../classes/ChatInputBarConfiguration.yaml | 111 +++--- .../classes/ChatWindowConfiguration.yaml | 106 +++--- .../classes/TextChatMessageProperties.yaml | 18 +- .../engine/classes/UIDragDetector.yaml | 72 ++-- .../engine/enums/UIDragSpeedAxisMapping.yaml | 26 +- content/en-us/ui/ui-drag-detectors.md | 27 ++ 24 files changed, 607 insertions(+), 326 deletions(-) create mode 100644 content/en-us/assets/players/in-experience-text-chat/Chat-NPC.jpg create mode 100644 content/en-us/assets/players/in-experience-text-chat/Chat-System.jpg create mode 100644 content/en-us/assets/players/in-experience-text-chat/Chat-Window-Components.jpg delete mode 100644 content/en-us/assets/players/in-experience-text-chat/ChatInputBarConfiguration-Enabled.png delete mode 100644 content/en-us/assets/players/in-experience-text-chat/ChatWindowConfiguration-Enabled.png delete mode 100644 content/en-us/assets/players/in-experience-text-chat/TextChatCommand-SizeCommand.png create mode 100644 content/en-us/assets/studio/explorer/TextChatService-ChannelTabsConfiguration.png create mode 100644 content/en-us/assets/studio/explorer/TextChatService-ChatInputBarConfiguration.png create mode 100644 content/en-us/assets/studio/explorer/TextChatService-ChatWindowConfiguration.png create mode 100644 content/en-us/assets/studio/explorer/TextChatService-TextChatCommand.png diff --git a/content/en-us/assets/players/in-experience-text-chat/Chat-NPC.jpg b/content/en-us/assets/players/in-experience-text-chat/Chat-NPC.jpg new file mode 100644 index 000000000..8b02e877e --- /dev/null +++ b/content/en-us/assets/players/in-experience-text-chat/Chat-NPC.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d0b6cdcc3468b3b77a51876700243257f9782e4d56295c16525c203fb75ce354 +size 283568 diff --git a/content/en-us/assets/players/in-experience-text-chat/Chat-System.jpg b/content/en-us/assets/players/in-experience-text-chat/Chat-System.jpg new file mode 100644 index 000000000..eccc11285 --- /dev/null +++ b/content/en-us/assets/players/in-experience-text-chat/Chat-System.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:421ff39d43bdc007dffac6655386fbb6d7a5f28a88ddb11e935bf9dc9e4629a9 +size 261425 diff --git a/content/en-us/assets/players/in-experience-text-chat/Chat-Tag-VIP.jpg b/content/en-us/assets/players/in-experience-text-chat/Chat-Tag-VIP.jpg index 608269d94..62e1808d7 100644 --- a/content/en-us/assets/players/in-experience-text-chat/Chat-Tag-VIP.jpg +++ b/content/en-us/assets/players/in-experience-text-chat/Chat-Tag-VIP.jpg @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8b11b3cf1b0b1be637772bc3b27771d8bdcac6ce087e4ed5c9ae93d7ac178958 -size 230728 +oid sha256:6ccf75427e06664c4322206e2a6b73b22d1e0bd880271e2794053902e2ab5b23 +size 269771 diff --git a/content/en-us/assets/players/in-experience-text-chat/Chat-Window-Components.jpg b/content/en-us/assets/players/in-experience-text-chat/Chat-Window-Components.jpg new file mode 100644 index 000000000..5fa2bbce6 --- /dev/null +++ b/content/en-us/assets/players/in-experience-text-chat/Chat-Window-Components.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ed598d4a7e20235a09fb4accca0c36de4c608c2cbfb600a0c46069dc37516b18 +size 305214 diff --git a/content/en-us/assets/players/in-experience-text-chat/ChatInputBarConfiguration-Enabled.png b/content/en-us/assets/players/in-experience-text-chat/ChatInputBarConfiguration-Enabled.png deleted file mode 100644 index 51e5878d6..000000000 --- a/content/en-us/assets/players/in-experience-text-chat/ChatInputBarConfiguration-Enabled.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0e8ba6bdd44038aaecd24e8e0497aed0c21376e8ec24b5b27065059f9b246f82 -size 25181 diff --git a/content/en-us/assets/players/in-experience-text-chat/ChatWindowConfiguration-Enabled.png b/content/en-us/assets/players/in-experience-text-chat/ChatWindowConfiguration-Enabled.png deleted file mode 100644 index 7683842e5..000000000 --- a/content/en-us/assets/players/in-experience-text-chat/ChatWindowConfiguration-Enabled.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bdbc1343e55594477a409a51e5974146e486a087c3df0ec7c820411d37fb5ed4 -size 28296 diff --git a/content/en-us/assets/players/in-experience-text-chat/Text-Custom-Command.mp4 b/content/en-us/assets/players/in-experience-text-chat/Text-Custom-Command.mp4 index 4609b73b0..63f1aeae8 100644 --- a/content/en-us/assets/players/in-experience-text-chat/Text-Custom-Command.mp4 +++ b/content/en-us/assets/players/in-experience-text-chat/Text-Custom-Command.mp4 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d1e4cd418e53158e2443d69fa83e45d643d6f311f10199e90f333fe495e02600 -size 7412273 +oid sha256:90d7fb13e35dceb716cbd76bdc37fe6e52b40b7a90c8b980a713c81f949e1c4a +size 7729703 diff --git a/content/en-us/assets/players/in-experience-text-chat/TextChatCommand-SizeCommand.png b/content/en-us/assets/players/in-experience-text-chat/TextChatCommand-SizeCommand.png deleted file mode 100644 index 54367498a..000000000 --- a/content/en-us/assets/players/in-experience-text-chat/TextChatCommand-SizeCommand.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b36fc1fca933cc2b2dc2cb95a191d3c045a30eaa62f74e8eec83d637e2118ba9 -size 18421 diff --git a/content/en-us/assets/players/in-experience-text-chat/TextChatService-Configuration-Objects.png b/content/en-us/assets/players/in-experience-text-chat/TextChatService-Configuration-Objects.png index 65f5c42da..d4cadeeda 100644 --- a/content/en-us/assets/players/in-experience-text-chat/TextChatService-Configuration-Objects.png +++ b/content/en-us/assets/players/in-experience-text-chat/TextChatService-Configuration-Objects.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:56847cb73f2439d35548db427c0ecc1dc25f28e89577ea6e27a3cf574cff4087 -size 65929 +oid sha256:b103928a9fe7845896c48acb98f33f114d23cea8da7ab151c2d90308ca2da90d +size 223174 diff --git a/content/en-us/assets/studio/explorer/TextChatService-ChannelTabsConfiguration.png b/content/en-us/assets/studio/explorer/TextChatService-ChannelTabsConfiguration.png new file mode 100644 index 000000000..05ea4ee16 --- /dev/null +++ b/content/en-us/assets/studio/explorer/TextChatService-ChannelTabsConfiguration.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a73a317bdaf47e8a2616d9a43fbfdfb28cf74ad061b48cee081d3034350c6876 +size 35843 diff --git a/content/en-us/assets/studio/explorer/TextChatService-ChatInputBarConfiguration.png b/content/en-us/assets/studio/explorer/TextChatService-ChatInputBarConfiguration.png new file mode 100644 index 000000000..e1a078ae1 --- /dev/null +++ b/content/en-us/assets/studio/explorer/TextChatService-ChatInputBarConfiguration.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a1278dc34e08cda716226918a3bae216a87fd73409f6eb51a2ee99642c2c986 +size 35898 diff --git a/content/en-us/assets/studio/explorer/TextChatService-ChatWindowConfiguration.png b/content/en-us/assets/studio/explorer/TextChatService-ChatWindowConfiguration.png new file mode 100644 index 000000000..ec0bb5d39 --- /dev/null +++ b/content/en-us/assets/studio/explorer/TextChatService-ChatWindowConfiguration.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ab14946f6310a2ae3899a66e10542db98487ab789f3aa9239dfcfcc26e55bf73 +size 35360 diff --git a/content/en-us/assets/studio/explorer/TextChatService-TextChatCommand.png b/content/en-us/assets/studio/explorer/TextChatService-TextChatCommand.png new file mode 100644 index 000000000..55b2996cd --- /dev/null +++ b/content/en-us/assets/studio/explorer/TextChatService-TextChatCommand.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:24bd0b7c7e23b26020ae7e3177a009d96a1fc83ba140c84c4df35147b0b4e600 +size 39194 diff --git a/content/en-us/chat/customizing-in-experience-text-chat.md b/content/en-us/chat/customizing-in-experience-text-chat.md index 314b0f80d..7a70c8352 100644 --- a/content/en-us/chat/customizing-in-experience-text-chat.md +++ b/content/en-us/chat/customizing-in-experience-text-chat.md @@ -1,51 +1,87 @@ --- -title: Customizing In-Experience Text Chat +title: Customizing Text Chat description: Customize the chat window and message UI of your in-experience text chat. --- -The [in-experience text chat system](../chat/in-experience-text-chat.md) powered by `Class.TextChatService` allows users to easily communicate and socialize with each other in live experiences. In addition to supporting the default text chat, you can customize the front-end user interface (UI) to improve your user engagement and immersion. +The [in-experience text chat](../chat/in-experience-text-chat.md) system, powered by `Class.TextChatService`, allows players to easily communicate and socialize with each other in live experiences. In addition to supporting the default text chat, you can [customize](#chat-window-configuration) the front‑end user interface. ## Chat Window Configuration -You can toggle appearance of the **chat window** and **input bar** in one of two ways: +The overall chat window consists of the **chat window**, an **input bar**, and optional **channel tabs**. -- Directly in Studio by toggling the **Enabled** property of the service's **ChatWindowConfiguration** and **ChatInputBarConfiguration** children. +Core components of the text chat window. - - - - - -
-
-
+The channel tabs are disabled by default and each component can be toggled on/off in Studio or through scripting: -- Through scripting, from a `Class.LocalScript` within `Class.StarterPlayerScripts`. +### Studio - ```lua title='LocalScript' highlight='3,4,7,10' - local TextChatService = game:GetService("TextChatService") +Directly in Studio's [Explorer](../studio/explorer.md) window, expand the `Class.TextChatService` branch and select `Class.ChatWindowConfiguration`, `Class.ChatInputBarConfiguration`, or `Class.ChannelTabsConfiguration`. Then, in the [Properties](../studio/properties.md) window, enable or disable the component. - local chatWindowConfiguration = TextChatService:FindFirstChildOfClass("ChatWindowConfiguration") - local chatInputBarConfiguration = TextChatService:FindFirstChildOfClass("ChatInputBarConfiguration") + - if chatWindowConfiguration then - chatWindowConfiguration.Enabled = true - end - if chatInputBarConfiguration then - chatInputBarConfiguration.Enabled = true - end - ``` +### Scripting -By default, when enabling both the chat window and the chat bar, the chat bar attaches to the chat window on the UI. You can obtain their read-only properties on their positions and sizes and use them to calculate the total size of the combination: +In a client script within `Class.StarterPlayerScripts`, enable each component as desired: -- `Class.ChatWindowConfiguration.AbsolutePosition` -- `Class.ChatWindowConfiguration.AbsoluteSize` -- `Class.ChatInputBarConfiguration.AbsolutePosition` -- `Class.ChatInputBarConfiguration.AbsoluteSize` +```lua title='Client Script' +local TextChatService = game:GetService("TextChatService") + +local ChatWindowConfiguration = TextChatService:FindFirstChildOfClass("ChatWindowConfiguration") +local ChatInputBarConfiguration = TextChatService:FindFirstChildOfClass("ChatInputBarConfiguration") +local ChannelTabsConfiguration = TextChatService:FindFirstChildOfClass("ChannelTabsConfiguration") + +-- Enable chat window +if ChatWindowConfiguration then + ChatWindowConfiguration.Enabled = true +end +-- Enable input bar +if ChatInputBarConfiguration then + ChatInputBarConfiguration.Enabled = true +end +-- Enable channel tabs +if ChannelTabsConfiguration then + ChannelTabsConfiguration.Enabled = true +end +``` -### Chat Window Customization +When `Class.ChannelTabsConfiguration` is enabled, each **default** `Class.TextChannel` will appear in a tab as outlined in the following table. In addition, each **custom** `Class.TextChannel` will create a tab corresponding to the channel's `Class.Instance.Name|Name` property. + + + + + + + + + + + + + + + + + + + + + + + + + + +
Default ChannelTab Name
**RBXGeneral****General**
**RBXSystem****General** (combined into a single tab with **RBXGeneral**)
**RBXTeam****Team**
**RBXWhisper**Username of other player
+ +### Appearance + +You can customize the chat window to match your experience's UI layout, design, and style by using the following properties: + +#### Chat Window -You can customize the default chat window to match your experience's UI layout, design, and style by using the following properties in Studio: +Appearance of the **chat window** is customizable through `Class.ChatWindowConfiguration`. + +ChatWindowConfiguration instance in Explorer hierarchy. @@ -56,82 +92,208 @@ You can customize the default chat window to match your experience's UI layout, - - - - + - - + + - - + + - + - + - + - - + + - + + + + + + + + - + - + + + +
**Appearance**
`Class.ChatWindowConfiguration.BackgroundColor3|BackgroundColor3`Background color of the chat window in `Datatype.Color3`.`Datatype.Color3` background color of the chat window. `[25, 27, 29]`
`Class.ChatWindowConfiguration.BackgroundTransparency|BackgroundTransparency`Transparency of the chat window.0.3Transparency of the chat window's background.`0.3`
`Class.ChatWindowConfiguration.FontFace|FontFace``Datatype.Font` of chat text displayed on the chat window.`Enum.Font.GothamMedium``Datatype.Font` of chat window text.`Enum.Font.BuilderSansMedium|BuilderSansMedium`
`Class.ChatWindowConfiguration.TextColor3|TextColor3`Color of chat text displayed on the chat window in `Datatype.Color3`.`Datatype.Color3` of chat window text. `[255, 255, 255]`
`Class.ChatWindowConfiguration.TextSize|TextSize`Size of chat text displayed on the chat window.Size of chat window text. `14`
`Class.ChatWindowConfiguration.TextStrokeColor3|TextStrokeColor3`Chat text stroke color displayed on the chat window in `Datatype.Color3`.`Datatype.Color3` of the stroke for chat window text. `[0, 0, 0]`
`Class.ChatWindowConfiguration.TextStrokeTransparency|TextStrokeTransparency`Transparency of chat text stroke displayed on the chat window.0.5Transparency of the stroke for chat window text.`0.5`
**Behavior**`Class.ChatWindowConfiguration.HorizontalAlignment|HorizontalAlignment`Horizontal alignment of the chat window.`Enum.HorizontalAlignment.Left|Left`
`Class.ChatWindowConfiguration.VerticalAlignment|VerticalAlignment`Vertical alignment of the chat window.`Enum.VerticalAlignment.Top|Top`
`Class.ChatWindowConfiguration.HeightScale|HeightScale` Height scale of the chat window relative to the screen size.1`1`
`Class.ChatWindowConfiguration.WidthScale|WidthScale` Width scale of the chat window relative to the screen size.1`1`
+ +#### Chat Input Bar + +Appearance of the **chat input bar** is customizable through `Class.ChatInputBarConfiguration`. + +ChatInputBarConfiguration instance in Explorer hierarchy. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyDescriptionDefault
`Class.ChatInputBarConfiguration.BackgroundColor3|BackgroundColor3``Datatype.Color3` background color of the chat input bar.`[25, 27, 29]`
`Class.ChatInputBarConfiguration.BackgroundTransparency|BackgroundTransparency`Transparency of the chat input bar's background.`0.2`
`Class.ChatInputBarConfiguration.FontFace|FontFace``Datatype.Font` of chat input text.`Enum.Font.BuilderSansMedium|BuilderSansMedium`
`Class.ChatInputBarConfiguration.PlaceholderColor3|PlaceholderColor3``Datatype.Color3` of placeholder chat input text.`[178, 178, 178]`
`Class.ChatInputBarConfiguration.TextColor3|TextColor3``Datatype.Color3` of player-entered chat input text.`[255, 255, 255]`
`Class.ChatInputBarConfiguration.TextSize|TextSize`Size of chat input text.`14`
`Class.ChatInputBarConfiguration.TextStrokeColor3|TextStrokeColor3``Datatype.Color3` stroke color of chat input text.`[0, 0, 0]`
`Class.ChatInputBarConfiguration.TextStrokeTransparency|TextStrokeTransparency`Transparency of the stroke for chat input text.`0.5`
`Class.ChatInputBarConfiguration.AutocompleteEnabled|AutocompleteEnabled`Whether the text chat system shows autocomplete options for emojis and [commands](../chat/in-experience-text-chat.md#creating-custom-commands). Emojis are autocompleted by typing `:` followed by non-whitespace characters, while commands are autocompleted by typing `/`.`true`
`Class.ChatInputBarConfiguration.KeyboardKeyCode|KeyboardKeyCode`Additional key players can press to trigger focusing on the default chat input bar.`Enum.KeyCode.Slash|Slash`
-### Emoji and Command Autocomplete +#### Channel Tabs -By default, the text chat system shows autocomplete options for emojis and [commands](../chat/in-experience-text-chat.md#creating-custom-commands): +Appearance of the **channel tabs** is customizable through `Class.ChannelTabsConfiguration`. -- Emojis are autocompleted by typing `:` followed by non-whitespace characters. -- Commands are autocompleted by typing `/`. +ChannelTabsConfiguration instance in Explorer hierarchy. -If you want to disable the autocomplete behavior, set the **AutocompleteEnabled** property to false through Studio UI or scripting. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyDescriptionDefault
`Class.ChannelTabsConfiguration.BackgroundColor3|BackgroundColor3``Datatype.Color3` background color of the channel tabs.`[25, 27, 29]`
`Class.ChannelTabsConfiguration.BackgroundTransparency|BackgroundTransparency`Transparency of the channel tabs' background.`0`
`Class.ChannelTabsConfiguration.HoverBackgroundColor3|HoverBackgroundColor3``Datatype.Color3` background color of tabs when hovering over them.`[125, 125, 125]`
`Class.ChannelTabsConfiguration.FontFace|FontFace``Datatype.Font` for the text in channel tabs.`Enum.Font.BuilderSansBold|BuilderSansBold`
`Class.ChannelTabsConfiguration.TextColor3|TextColor3``Datatype.Color3` of text in an unselected tab.`[175, 175, 175]`
`Class.ChannelTabsConfiguration.SelectedTabTextColor3|SelectedTabTextColor3``Datatype.Color3` of text in a selected tab.`[255, 255, 255]`
`Class.ChannelTabsConfiguration.TextSize|TextSize`Size of the text in channel tabs.`18`
`Class.ChannelTabsConfiguration.TextStrokeColor3|TextStrokeColor3``Datatype.Color3` stroke color of the text in channel tabs.`[0, 0, 0]`
`Class.ChannelTabsConfiguration.TextStrokeTransparency|TextStrokeTransparency`Transparency of the stroke for text in channel tabs.`1`
-## Customizing Message Appearance +## Customizing Messages -You can customize the appearance of chat message bodies and prefixes using [rich text](../ui/rich-text.md) tags and `Class.TextChatService.OnIncomingMessage` callbacks without overriding the existing UI. The customization options let you modify the appearance of chat messages to match your experience's theme, and you can also sort or highlight messages from different user groups by [adding chat tags](#adding-chat-tags) and [coloring usernames](#coloring-usernames). +You can customize the appearance of chat message bodies and prefixes using [rich text](../ui/rich-text.md) tags and `Class.TextChatService.OnIncomingMessage` callbacks without overriding the existing UI. The customization options let you modify the appearance of chat messages to match your experience's theme, and you can also sort or highlight messages from different player groups. - You should only define `Class.TextChatService.OnIncomingMessage` once in the source code. Multiple bindings might override one another in an unpredictable manner. +You should only define `Class.TextChatService.OnIncomingMessage` once in the source code. Multiple bindings might override one another in an unpredictable manner. -### Adding Chat Tags +### Message Prefixes -If your experience has users with special [attributes](../studio/properties.md#instance-attributes) like VIP status, you can attach chat tags wrapped in brackets to the front of user messages to highlight their chat messages. The following `Class.LocalScript` in `Class.StarterPlayerScripts` examines all `Class.Player` instances representing users in your experience and appends VIP chat tags for those with the `IsVIP` attribute. +If your experience has players with special [attributes](../studio/properties.md#instance-attributes) like VIP status, you can prefix chat tags to highlight their chat messages. The following client script in `Class.StarterPlayerScripts` examines all `Class.Player` instances representing players in your experience and appends VIP chat tags for those with the `IsVIP` attribute. -```lua title='LocalScript' highlight='4,5,9-11' +```lua title='Client Script' local TextChatService = game:GetService("TextChatService") local Players = game:GetService("Players") @@ -149,16 +311,13 @@ TextChatService.OnIncomingMessage = function(message: TextChatMessage) end ``` -VIP users' chat tags +VIP player's chat tags -### Coloring Usernames +### Username Colors -When a user sends a chat message, their username displays as the prefix portion of the message. By default, each user's name is colored according to their `Class.Team.TeamColor|TeamColor` but you can change the colors of chat usernames using `Class.TextChatService.OnIncomingMessage` and [font color tags](../ui/rich-text.md#supported-tags). The following `Class.LocalScript` in `Class.StarterPlayerScripts` assigns a predetermined color to each user, picking randomly from a table of RGB colors. +When a player sends a chat message, their username displays as the prefix portion of the message. By default, each player's name is colored according to their `Class.Team.TeamColor|TeamColor` but you can change the colors of chat usernames using `Class.TextChatService.OnIncomingMessage` and [font color tags](../ui/rich-text.md#supported-tags). The following client script in `Class.StarterPlayerScripts` assigns a predetermined color to each player, picking randomly from a table of RGB colors. -```lua title='LocalScript' hightlight='10,11,17' +```lua title='Client Script' hightlight='10,11,17' local TextChatService = game:GetService("TextChatService") local nameColors = { @@ -182,11 +341,11 @@ TextChatService.OnIncomingMessage = function(textChatMessage: TextChatMessage) end ``` -### Customizing Translated Messages +### Chat Translations By default, Roblox [automatically translates](../production/localization/automatic-translations.md) text chat messages based on users' language settings. To apply message customizations to translated messages, use the `Class.TextChatMessage.Translation` property. The following example, a `Class.Script` in `Class.ReplicatedStorage` with its `Enum.RunContext` property as `Enum.RunContext|Client`, sets the font color of translated messages to the same color as untranslated messages. -```lua title='Script' +```lua title='Client Script' local TextChatService = game:GetService("TextChatService") local FONT_COLOR = "#FF007F" @@ -207,19 +366,57 @@ end TextChatService.OnIncomingMessage = onIncomingChatMessage ``` -## Displaying System Messages +## Sending Messages from Non‑Player Sources -Through `Class.TextChannel:DisplaySystemMessage()`, you can display a system-like message, useful for greeting users or alerting them when an in-experience event is happening. +In certain design scenarios, you may want to show non‑player dialogue in the chat window, such as "speech" from a public address system or a non‑player character. -```lua title='LocalScript' +### System + +To deliver an unstyled system message to the local player, simply call `Class.TextChannel:DisplaySystemMessage()|DisplaySystemMessage()` from the default **RBXGeneral** channel with a prefix before the player's display name. + +```lua title='Client Script' local Players = game:GetService("Players") local TextChatService = game:GetService("TextChatService") -local generalChannel = TextChatService.TextChannels.RBXGeneral +local player = Players.LocalPlayer +local generalChannel: TextChannel = TextChatService:WaitForChild("TextChannels").RBXGeneral + +local PREFIX = "[Guide] Welcome " -generalChannel:DisplaySystemMessage("[Server] Hello " .. Players.LocalPlayer.Name) +-- Send "system message" to player with their display name appended +generalChannel:DisplaySystemMessage(PREFIX .. player.DisplayName) ``` -## Adding Chat Bubbles +Image showing a basic system message in the chat window. + +### NPC/Object + +You can also stylize non-player dialogue and add [chat bubbles](../chat/bubble-chat.md) to make it appear like messages are coming from an NPC or object within the 3D world. + +```lua title='Client Script' +local TextChatService = game:GetService("TextChatService") + +local generalChannel: TextChannel = TextChatService:WaitForChild("TextChannels").RBXGeneral + +TextChatService.OnIncomingMessage = function(textChatMessage: TextChatMessage) + local properties = Instance.new("TextChatMessageProperties") + + -- Check for system messages that contain metadata + if not textChatMessage.TextSource and textChatMessage.Metadata ~= "" then + + -- Add prefix to make message look like it was sent by a player + properties.PrefixText = string.format("%s: ", "#50C999", textChatMessage.Metadata) + + -- Add bubble chat + TextChatService:DisplayBubble(workspace.Statue, textChatMessage.Text) + end + + return properties +end + +local message = "Welcome! I will be your guide." +local speakerName = "Ancient Knight" +generalChannel:DisplaySystemMessage(message, speakerName) +``` -In addition to displaying messages on the chat window, you can add and customize chat bubbles above user avatars and NPC characters for immersive engagement. For more information, see [Bubble Chat](../chat/bubble-chat.md). +Image showing a knight statue NPC broadcasting a chat message to the chat window, along with a chat bubble above its head. diff --git a/content/en-us/chat/in-experience-text-chat.md b/content/en-us/chat/in-experience-text-chat.md index 15a8389d6..4b415017c 100644 --- a/content/en-us/chat/in-experience-text-chat.md +++ b/content/en-us/chat/in-experience-text-chat.md @@ -1,37 +1,37 @@ --- -title: In-Experience Text Chat System -description: The in-experience text chat system allows users to communicate with each other using text-based messages in live sessions. +title: In-Experience Text Chat +description: The in-experience text chat system allows players to communicate with each other using text-based messages in live sessions. --- -With the **in-experience text chat** system on Roblox, you can allow users to communicate with each other using text-based messages in live sessions. The system provides a set of methods and events for extending and customizing chat functionalities for enhanced user immersion and engagement, such as delivering messages based on customized requirements, adding special permissions or moderation to specific users, and creating custom commands to execute specific actions. +With the **in-experience text chat** system on Roblox, players can communicate with each other using text-based messages in live sessions. The system provides a set of methods and events for extending and customizing chat functionalities, such as delivering messages based on [customized requirements](#customizing-message-delivery-behaviors), adding special permissions or moderation to specific players, and creating [custom commands](#creating-custom-commands) to execute specific actions. -This guide covers the chat workflow and the usage of APIs for extending the functionalities of the in-experience text chat system. For more information on customizing the chat User Interface (UI), see [Customizing In-Experience Text Chat](../chat/customizing-in-experience-text-chat.md). +This guide covers the chat workflow and approaches for extending the functionalities of the chat system. For more information on customizing the chat user interface (UI), see [Customizing Text Chat](../chat/customizing-in-experience-text-chat.md). -## Chat APIs and Workflow +## Chat Workflow -The in-experience text chat system consists of both mutable APIs that you can extend for customized chat delivery behaviors and immutable data objects representing certain chat elements returned by mutable APIs. +The in-experience text chat system consists of both [mutable classes](#mutable-chat-classes) that you can extend for customized chat delivery behaviors and [immutable data objects](#immutable-chat-objects) representing certain chat elements returned by mutable classes. -### Mutable Chat APIs +### Mutable Chat Classes -The in-experience text chat system provides the following mutable APIs: +The in-experience text chat system provides the following mutable classes: -- `Class.TextChatService` — This singleton class is responsible for managing the overall chat system, including handling chat message filtering, moderation, and user permissions. Accessible from the server, it provides a set of methods and events that other text chat APIs or user actions can invoke through the chat delivery workflow. -- `Class.TextChannel` — This class represents a text chat channel that passes user-sent chat messages from the client to the server and displays them to other users based on permissions. You can use it to create, modify, and manage text channels in your experience. Additionally, you can create multiple text channels to group users together for chat purposes, such as allowing users to chat with their group members that are not visible to others. -- `Class.TextChatCommand` — This class enables you to create custom chat commands that allow users to invoke specific actions or behaviors by typing special characters followed by a command name. Chat commands are helpful for adding additional functionality and interactivity to the chat experience. You can also use them to create admin commands to manage and moderate your experience with shortcuts. +- `Class.TextChatService` — This singleton class is responsible for managing the overall chat system, including handling chat message filtering, moderation, and user permissions. Accessible from the server, it provides a set of methods and events that other text chat APIs or player actions can invoke through the chat delivery workflow. +- `Class.TextChannel` — This class represents a text chat channel that passes player-sent chat messages from the client to the server and displays them to other players based on permissions. You can use it to create, modify, and manage text channels in your experience. Additionally, you can create multiple text channels to group players together for chat purposes, such as allowing players to chat with their group members that are not visible to others. +- `Class.TextChatCommand` — This class enables you to create custom chat commands that allow players to invoke specific actions or behaviors by typing special characters followed by a command name. Chat commands are helpful for adding additional functionality and interactivity to the chat experience. You can also use them to create admin commands to manage and moderate your experience with shortcuts. ### Immutable Chat Objects The in-experience text chat system includes the following immutable objects with read-only properties that you can't modify: - `Class.TextChatMessage`: This object represents a single chat message in a text chat channel with basic information such as the sender of the message, the original message, the filtered message, and the creation timestamp. -- `Class.TextSource`: This object represents a message sender in a text chat channel with detailed permissions of a user in the channel. If a user is in multiple text chat channels, they can have multiple text sources as well. +- `Class.TextSource`: This object represents a message sender in a text chat channel with detailed permissions of a player in the channel. If a player is in multiple text chat channels, they can have multiple text sources as well. -### Text Chat Workflow +### Chat Flowchart -Through the chat message sending and delivering process, methods, callbacks, and events of mutable chat classes carrying immutable chat objects take place on three sides of the client-server model: +Through the chat message sending and delivery process, methods, callbacks, and events of mutable chat classes work alongside immutable chat objects on three sides of the [client‑server](../projects/client-server.md) model: -- The sending client, which is the local device of a user sending a message. -- Receiving clients, which are other users' local devices. +- The sending client, which is the local device of a player sending a message. +- Receiving clients, which are other players' local devices. - The server, which is the central processor for receiving the message from the sending client and handles the delivery to receiving clients. + 1. Set its **PrimaryAlias** property to `/super` and its **SecondaryAlias** to `/mini`. @@ -163,7 +159,7 @@ To switch the chat system of an existing experience from the legacy chat system -### Basic Chat Functionalities +### Basic Functionalities Though both systems share the same basic chat functionalities, the in-experience text chat system implementations are in general more sustainable and easier to iterate on. @@ -209,9 +205,9 @@ Though both systems share the same basic chat functionalities, the in-experience -### Chat Message Filtering +### Message Filtering -The in-experience text chat system automatically filters chat messages based on each user's account information, so you don't need to manually implement text filtering for all kinds of chat messages. +The in-experience text chat system automatically filters chat messages based on each player's account information, so you don't need to manually implement text filtering for all kinds of chat messages. @@ -223,7 +219,7 @@ The in-experience text chat system automatically filters chat messages based on - + @@ -235,7 +231,7 @@ The in-experience text chat system automatically filters chat messages based on
Filter Message for Individual UserFilter Message for Individual Player `Class.Chat:FilterStringAsync()` n/a
-### Chat Window and Bubble Chat +### Window and Bubble Chat Both the chat window and [bubble chat](../chat/bubble-chat.md) behavior and [customization](../chat/customizing-in-experience-text-chat.md) options of the in-experience text chat system are identical to those of the legacy chat system. As the legacy chat system only allows customization using chat modules or the `Class.Players` container, the in-experience text chat system provides dedicated classes, `Class.ChatWindowConfiguration` and `Class.BubbleChatConfiguration`, to manage all chat window and bubble chat properties respectively. Additionally, you can easily adjust and preview your bubble chat appearance and behavior properties using Studio settings instead of having to script them all. diff --git a/content/en-us/chat/legacy/admin-commands.md b/content/en-us/chat/legacy/admin-commands.md index ecc0c763a..5fb59c64e 100644 --- a/content/en-us/chat/legacy/admin-commands.md +++ b/content/en-us/chat/legacy/admin-commands.md @@ -6,7 +6,7 @@ comments: | --- - This guide covers admin commands of the legacy chat system, which is deprecated and no longer onboarding new users in favor of `Class.TextChatService` with easier and more modern chat settings. If you are using the default chat system powered by `Class.TextChatService`, see In-Experience Text Chat for creating custom chat commands. + This guide covers admin commands of the legacy chat system, which is deprecated and no longer onboarding new users in favor of `Class.TextChatService` with easier and more modern chat settings. If you are using the default chat system powered by `Class.TextChatService`, see [In-Experience Text Chat](../../chat/in-experience-text-chat.md#creating-custom-commands) for creating custom chat commands. An **admin command** is a keyword or phrase that a user with certain level of control can type into the chat window to trigger an action. This library uses chat modules, which allows for easy implementation of admin commands on top of the legacy chat system. Chat modules listen to incoming messages on the server and can execute actions based on whatever criteria is desired. diff --git a/content/en-us/chat/voice-chat.md b/content/en-us/chat/voice-chat.md index 8c046080c..77801bd5f 100644 --- a/content/en-us/chat/voice-chat.md +++ b/content/en-us/chat/voice-chat.md @@ -4,7 +4,7 @@ description: Explains how to use the proximity-based voice chat feature. --- -Voice chat is currently available to all 13+ [phone number verified](../production/publishing/account-verification.md#verifying-through-phone-number) users in these countries: US, CA, GB, IE, AU, NZ, ES, MX, CL, CR, PR, FR, IT, AT, CHE, DE, JP, KR, CH, AR, COL, PE, DO, GT, UY, SV, HN, PY, NI, EC, BO, VE, PA. Users **not** in these countries should use [ID verification](https://en.help.roblox.com/hc/en-us/articles/4407282410644) to enable chat with voice. Once verified, eligible 13+ phone verified users can opt‑in to use this feature by visiting their account **Settings** page or from within a voice enabled experience, allowing them to chat with voice in any Roblox experience that supports it. Experiences with voice often see an uplift in engagement, DAU, and spending. +Voice chat is currently available to all 13+ [phone number verified](../production/publishing/account-verification.md#verifying-through-phone-number) users in these countries: US, CA, GB, IE, AU, NZ, ES, MX, CL, CR, PR, FR, IT, AT, CHE, DE, JP, KR, CH, AR, COL, PE, DO, GT, UY, SV, HN, PY, NI, EC, BO, VE, PA, PT, and BR. Users **not** in these countries should use [ID verification](https://en.help.roblox.com/hc/en-us/articles/4407282410644) to enable chat with voice. Once verified, eligible 13+ phone verified users can opt‑in to use this feature by visiting their account **Settings** page or from within a voice enabled experience, allowing them to chat with voice in any Roblox experience that supports it. Experiences with voice often see an uplift in engagement, DAU, and spending. **Voice chat** is a proximity-based chat feature that simulates realistic communication based on how close you are to other users who are speaking. The closer you are to another user's avatar, the louder their voice; conversely, the farther away you are, the softer their voice. diff --git a/content/en-us/reference/engine/classes/ChannelTabsConfiguration.yaml b/content/en-us/reference/engine/classes/ChannelTabsConfiguration.yaml index d8c2f179a..aff6ace85 100644 --- a/content/en-us/reference/engine/classes/ChannelTabsConfiguration.yaml +++ b/content/en-us/reference/engine/classes/ChannelTabsConfiguration.yaml @@ -2,8 +2,11 @@ name: ChannelTabsConfiguration type: class category: memory_category: Instances -summary: '' -description: '' +summary: | + Configures properties of the optional channel tabs in the default chat window. +description: | + Configures properties of the optional channel tabs in the default chat window. + It is parented to `Class.TextChatService`. code_samples: [] inherits: - TextChatConfigurations @@ -12,8 +15,10 @@ tags: deprecation_message: '' properties: - name: ChannelTabsConfiguration.AbsolutePosition - summary: '' - description: '' + summary: | + Actual screen position of the channel tab bar, in pixels. + description: | + Read-only property that provides the screen position of the channel tab bar in pixels. Behaves similarly to `Class.GuiBase2d.AbsolutePosition`. code_samples: [] type: Vector2 tags: @@ -29,8 +34,10 @@ properties: can_load: false can_save: false - name: ChannelTabsConfiguration.AbsoluteSize - summary: '' - description: '' + summary: | + Actual screen size of the channel tab bar, in pixels. + description: | + Read-only property that provides the screen size of the channel tab bar in pixels. Behaves similarly to `Class.GuiBase2d.AbsoluteSize`. code_samples: [] type: Vector2 tags: @@ -46,8 +53,14 @@ properties: can_load: false can_save: false - name: ChannelTabsConfiguration.BackgroundColor3 - summary: '' - description: '' + summary: | + Background color of the channel tabs. + description: | + Background color of the channel tabs. If the background color is not + overridden, this value will respect the user's + `Class.GuiService.PreferredTransparency` by making the menu more gray as + the transparency of the menu decreases. Default value is + `Datatype.Color3|Color3.new(25, 27, 29)`. code_samples: [] type: Color3 tags: [] @@ -61,8 +74,14 @@ properties: can_load: true can_save: true - name: ChannelTabsConfiguration.BackgroundTransparency - summary: '' - description: '' + summary: | + Background transparency of the channel tabs. + description: | + Background transparency of the channel tabs as a number between `0` and + `1`. This value is multiplied with the user's + `Class.GuiService.PreferredTransparency` to create the effective + background transparency used by the channel tabs, which may be more opaque + than this value set here. Default value is `0`. code_samples: [] type: double tags: [] @@ -76,8 +95,10 @@ properties: can_load: true can_save: true - name: ChannelTabsConfiguration.Enabled - summary: '' - description: '' + summary: | + Whether to show the channel tabs. + description: | + Whether to show the channel tabs. Set to `false` to hide. code_samples: [] type: bool tags: [] @@ -91,8 +112,10 @@ properties: can_load: true can_save: true - name: ChannelTabsConfiguration.FontFace - summary: '' - description: '' + summary: | + Font used to render text in the channel tabs. + description: | + Font used to render text in the channel tabs. Default is `Enum.Font.BuilderSansBold`. code_samples: [] type: Font tags: [] @@ -106,8 +129,11 @@ properties: can_load: true can_save: true - name: ChannelTabsConfiguration.HoverBackgroundColor3 - summary: '' - description: '' + summary: | + Background color of a channel tab when hovering over it. + description: | + Background color of a channel tab when hovering over it. Default value is + `Datatype.Color3|Color3.new(125, 125, 125)`. code_samples: [] type: Color3 tags: [] @@ -121,8 +147,11 @@ properties: can_load: true can_save: true - name: ChannelTabsConfiguration.SelectedTabTextColor3 - summary: '' - description: '' + summary: | + Color of text in a selected tab. + description: | + Color of text in a selected tab. Default value is + `Datatype.Color3|Color3.new(255, 255, 255)`. code_samples: [] type: Color3 tags: [] @@ -136,8 +165,11 @@ properties: can_load: true can_save: true - name: ChannelTabsConfiguration.TextColor3 - summary: '' - description: '' + summary: | + Color of text in an unselected tab. + description: | + Color of text in an unselected tab. Default value is + `Datatype.Color3|Color3.new(175, 175, 175)`. code_samples: [] type: Color3 tags: [] @@ -151,8 +183,10 @@ properties: can_load: true can_save: true - name: ChannelTabsConfiguration.TextSize - summary: '' - description: '' + summary: | + Size of the text in channel tabs. + description: | + Size of the text in channel tabs. Default value is `14`. code_samples: [] type: int64 tags: [] @@ -166,8 +200,11 @@ properties: can_load: true can_save: true - name: ChannelTabsConfiguration.TextStrokeColor3 - summary: '' - description: '' + summary: | + Color of the text stroke for text in channel tabs. + description: | + Color of the text stroke for text in channel tabs. Default value is + `Datatype.Color3|Color3.new(0, 0, 0)`. code_samples: [] type: Color3 tags: [] @@ -181,8 +218,11 @@ properties: can_load: true can_save: true - name: ChannelTabsConfiguration.TextStrokeTransparency - summary: '' - description: '' + summary: | + Transparency of the text stroke for text in channel tabs. + description: | + Transparency of the text stroke for text in channel tabs. Default value is + `1`. code_samples: [] type: double tags: [] diff --git a/content/en-us/reference/engine/classes/ChatInputBarConfiguration.yaml b/content/en-us/reference/engine/classes/ChatInputBarConfiguration.yaml index e4a21c2d4..9ce432b5b 100644 --- a/content/en-us/reference/engine/classes/ChatInputBarConfiguration.yaml +++ b/content/en-us/reference/engine/classes/ChatInputBarConfiguration.yaml @@ -5,9 +5,8 @@ memory_category: Instances summary: | Configures properties of the default chat input bar. description: | - Configures properties of the default chat input bar. - - It is parented to `Class.TextChatService`. + Configures properties of the default text chat input bar. It is parented to + `Class.TextChatService`. code_samples: [] inherits: - TextChatConfigurations @@ -17,8 +16,7 @@ deprecation_message: '' properties: - name: ChatInputBarConfiguration.AbsolutePosition summary: | - Describes the actual screen position of the default chat input bar in - pixels. + Actual screen position of the default chat input bar in pixels. description: | Read-only property that provides the screen position of the default chat input bar in pixels. Behaves similarly to @@ -39,7 +37,7 @@ properties: can_save: false - name: ChatInputBarConfiguration.AbsoluteSize summary: | - Describes the actual screen size of the default chat input bar in pixels. + Actual screen size of the default chat input bar in pixels. description: | Read-only property that provides the screen size of the default chat input bar in pixels. Behaves similarly to `Class.GuiBase2d.AbsoluteSize`. @@ -59,10 +57,10 @@ properties: can_save: false - name: ChatInputBarConfiguration.AutocompleteEnabled summary: | - Determines whether to enable autocomplete for the chat input bar. + Whether to enable autocomplete for the chat input bar. description: | - Determines whether to enable autocomplete for the chat input bar. Set to - false to disable autocomplete. + Whether to enable autocomplete for the chat input bar. Set to `false` to + disable autocomplete. code_samples: [] type: bool tags: [] @@ -77,10 +75,10 @@ properties: can_save: true - name: ChatInputBarConfiguration.BackgroundColor3 summary: | - Determines the background color of the default chat input bar. + Background color of the default chat input bar. description: | - Determines the background color of the default chat input bar. Default - value is `Datatype.Color3|Color3.new(25,27,29)`. + Background color of the default chat input bar. Default value is + `Datatype.Color3|Color3.new(25, 27, 29)`. code_samples: [] type: Color3 tags: [] @@ -95,13 +93,13 @@ properties: can_save: true - name: ChatInputBarConfiguration.BackgroundTransparency summary: | - Determines the background transparency of the default chat input bar. + Background transparency of the default chat input bar. description: | - Determines the background transparency of the default chat input bar as a - number between 0 and 1. This value is multiplied with the user's + Background transparency of the default chat input bar as a number between + `0` and `1`. This value is multiplied with the user's `Class.GuiService.PreferredTransparency` to create the effective background transparency used by the chat input bar, which may be more - opaque than this value set here. Default value is 0.2. + opaque than this value set here. Default value is `0.2`. code_samples: [] type: double tags: [] @@ -116,11 +114,9 @@ properties: can_save: true - name: ChatInputBarConfiguration.Enabled summary: | - Determines whether to show the default chat input bar. + Whether to show the default chat input bar. description: | - Determines whether to show the default chat input bar. - - Set to false to hide the default chat input bar. + Whether to show the default chat input bar. Set to `false` to hide. code_samples: [] type: bool tags: [] @@ -135,9 +131,9 @@ properties: can_save: true - name: ChatInputBarConfiguration.FontFace summary: | - Determines the font used to render text in the default chat input bar. + Font used to render text in the default chat input bar. description: | - Determines the font used to render text in the default chat input bar. + Font used to render text in the default chat input bar. Default is `Enum.Font.BuilderSansMedium`. code_samples: [] type: Font tags: [] @@ -152,7 +148,7 @@ properties: can_save: true - name: ChatInputBarConfiguration.IsFocused summary: | - Describes if the default chat input bar is focused or not. + Whether the default chat input bar is focused or not. description: | Indicates whether the default chat input bar is focused or not. Useful for firing property changed events so you can implement callback functions @@ -174,12 +170,12 @@ properties: can_save: false - name: ChatInputBarConfiguration.KeyboardKeyCode summary: | - Determines an additional key users can press to trigger focusing on the - default chat input bar. + Additional key users can press to trigger focusing on the default chat + input bar. description: | - Determines an additional key users can press to trigger focusing on the - default chat input bar. Useful when you want to have an extra hotkey for - focusing in addition to the "/" key. + Additional key users can press to trigger focusing on the default chat + input bar. Useful when you want to have an extra hotkey for focusing in + addition to the / key. code_samples: [] type: KeyCode tags: [] @@ -194,12 +190,10 @@ properties: can_save: true - name: ChatInputBarConfiguration.PlaceholderColor3 summary: | - Determines the color of the text of the placeholder text in the default - chat input bar. + Color of the text of the placeholder text in the default chat input bar. description: | - Determines the color of the text of the placeholder text in the default - chat input bar. Default value is - `Datatype.Color3|Color3.new(178, 178, 178)`. + Color of the text of the placeholder text in the default chat input bar. + Default value is `Datatype.Color3|Color3.new(178, 178, 178)`. code_samples: [] type: Color3 tags: [] @@ -216,8 +210,6 @@ properties: summary: | A reference to the target `Class.TextChannel`. description: | - A reference to the target `Class.TextChannel`. - Determines which `Class.TextChannel` to use when the user sends a message with the default chat input bar. code_samples: [] @@ -234,28 +226,27 @@ properties: can_save: true - name: ChatInputBarConfiguration.TextBox summary: | - A reference to a designated `Class.TextBox` Instance that sends messages - on behalf of the user. This property only accepts TextBox instances. + Reference to a designated `Class.TextBox` instance that sends messages on + behalf of the user. description: | - A reference to a designated `Class.TextBox` Instance that sends messages - on behalf of the user. This property only accepts TextBox instances. - - You can use it to further integrate your custom chat input bar UI into - your experience by freely manipulating appearance, location, and layout. - When opting to set this property to a custom TextBox, you don't need to - write any code for the following behavior: + Reference to a designated `Class.TextBox` instance that sends messages on + behalf of the user. You can use it to further integrate your custom chat + input bar UI into your experience by freely manipulating appearance, + location, and layout. When opting to set this property to a custom + `Class.TextBox`, you don't need to write any code for the following + behavior: - When a user types a message and presses `Enum.KeyCode.Return`, the message will be sent to `Class.ChatInputBarConfiguration.TargetTextChannel`. - When a message is sent, `Class.TextBox.Text` will automatically clear. - For security, some limitations are imposed on the TextBox when it is - promoted to `Class.ChatInputBarConfiguration.TextBox`. Lua code will not - be able to: + For security, some limitations are imposed on the `Class.TextBox` when it + is promoted to `Class.ChatInputBarConfiguration.TextBox`. Lua code will + not be able to: - Change the `Class.TextBox.Text` property. - - Use the `Class.TextBox.CaptureFocus` or `Class.TextBox.ReleaseFocus` + - Use the `Class.TextBox:CaptureFocus()` or `Class.TextBox:ReleaseFocus()` methods. code_samples: [] type: TextBox @@ -271,10 +262,10 @@ properties: can_save: false - name: ChatInputBarConfiguration.TextColor3 summary: | - Determines the color of the text in default chat input bar. + Color of the text in default chat input bar. description: | - Determines the color of the text in default chat input bar. Default value - is `Datatype.Color3|Color3.new(255, 255, 255)` (white). + Color of the text in default chat input bar. Default value is + `Datatype.Color3|Color3.new(255, 255, 255)`. code_samples: [] type: Color3 tags: [] @@ -289,10 +280,9 @@ properties: can_save: true - name: ChatInputBarConfiguration.TextSize summary: | - Determines the size of the text in default chat input bar. + Size of the text in default chat input bar. description: | - Determines the size of the text in default chat input bar. Default value - is 14. + Size of the text in default chat input bar. Default value is `14`. code_samples: [] type: int64 tags: [] @@ -307,10 +297,10 @@ properties: can_save: true - name: ChatInputBarConfiguration.TextStrokeColor3 summary: | - Determines the color of the text stroke of text in default chat input bar. + Color of the text stroke for text in default chat input bar. description: | - Determines the color of the text stroke of text in default chat input bar. - Default value is `Datatype.Color3|Color3.new(0, 0, 0)` (black). + Color of the text stroke for text in default chat input bar. Default value + is `Datatype.Color3|Color3.new(0, 0, 0)`. code_samples: [] type: Color3 tags: [] @@ -325,11 +315,10 @@ properties: can_save: true - name: ChatInputBarConfiguration.TextStrokeTransparency summary: | - Determines the transparency of the text stroke of text in default chat - input bar. + Transparency of the text stroke for text in default chat input bar. description: | - Determines the color of the text stroke of text in default chat input bar. - Default value is 0.5. + Transparency of the text stroke for text in default chat input bar. + Default value is `0.5`. code_samples: [] type: double tags: [] diff --git a/content/en-us/reference/engine/classes/ChatWindowConfiguration.yaml b/content/en-us/reference/engine/classes/ChatWindowConfiguration.yaml index 8f86a81fd..dcceaa124 100644 --- a/content/en-us/reference/engine/classes/ChatWindowConfiguration.yaml +++ b/content/en-us/reference/engine/classes/ChatWindowConfiguration.yaml @@ -5,9 +5,8 @@ memory_category: Instances summary: | Configures properties of the default chat window. description: | - Configures properties of the default chat window. - - It is parented to `Class.TextChatService`. + Configures properties of the default text chat window. It is parented to + `Class.TextChatService`. code_samples: [] inherits: - TextChatConfigurations @@ -17,8 +16,7 @@ deprecation_message: '' properties: - name: ChatWindowConfiguration.AbsolutePosition summary: | - Describes the actual screen position of the default chat window, in - pixels. + Actual screen position of the default chat window, in pixels. description: | Read-only property that provides the screen position of the default chat window in pixels. Behaves similarly to `Class.GuiBase2d.AbsolutePosition`. @@ -38,7 +36,7 @@ properties: can_save: false - name: ChatWindowConfiguration.AbsoluteSize summary: | - Describes the actual screen size of the default chat window, in pixels. + Actual screen size of the default chat window, in pixels. description: | Read-only property that provides the screen size of the default chat window in pixels. Behaves similarly to `Class.GuiBase2d.AbsoluteSize`. @@ -58,13 +56,13 @@ properties: can_save: false - name: ChatWindowConfiguration.BackgroundColor3 summary: | - Determines the background color of the default chat window. + Background color of the default chat window. description: | - Determines the background color of the default chat window. If the - background color is not overridden, this value will respect the user's + Background color of the default chat window. If the background color is + not overridden, this value will respect the user's `Class.GuiService.PreferredTransparency` by making the menu more gray as the transparency of the menu decreases. Default value is - `Datatype.Color3|Color3.new(25,27,29)`. + `Datatype.Color3|Color3.new(25, 27, 29)`. code_samples: [] type: Color3 tags: [] @@ -79,13 +77,13 @@ properties: can_save: true - name: ChatWindowConfiguration.BackgroundTransparency summary: | - Determines the background transparency of the default chat window. + Background transparency of the default chat window. description: | - Determines the background transparency of the default chat window in a - number between 0 and 1. This value is multiplied with the user's + Background transparency of the default chat window as a number between `0` + and `1`. This value is multiplied with the user's `Class.GuiService.PreferredTransparency` to create the effective background transparency used by the chat window, which may be more opaque - than this value set here. Default value is 0.3. + than this value set here. Default value is `0.3`. code_samples: [] type: double tags: [] @@ -100,11 +98,9 @@ properties: can_save: true - name: ChatWindowConfiguration.Enabled summary: | - Determines whether to show the default chat window. + Whether to show the default chat window. description: | - Determines whether to show the default chat window. - - Set to `false` to hide the default chat window. + Whether to show the default chat window. Set to `false` to hide. code_samples: [] type: bool tags: [] @@ -119,9 +115,9 @@ properties: can_save: true - name: ChatWindowConfiguration.FontFace summary: | - Determines the font used to render text in the default chat window. + Font used to render text in the default chat window. description: | - Determines the font used to render text in the default chat window. + Font used to render text in the default chat window. Default is `Enum.Font.BuilderSansMedium`. code_samples: [] type: Font tags: [] @@ -136,12 +132,11 @@ properties: can_save: true - name: ChatWindowConfiguration.HeightScale summary: | - Determines by what factor the height of the default chat window should be - scaled. + Factor by which the height of the default chat window should be scaled. description: | - Determines by what factor the height of the default chat window should be - scaled. Must be a value between 0.5 and 2. Defining a value outside of - range clamps the actual value to the closest bound. + Factor by which the height of the default chat window should be scaled. + Must be a value between `0.5` and `2`. Defining a value outside of range + clamps the actual value to the closest bound. code_samples: [] type: float tags: [] @@ -156,13 +151,15 @@ properties: can_save: true - name: ChatWindowConfiguration.HorizontalAlignment summary: | - Determines the horizontal alignment of the chat window. + Horizontal alignment of the chat window. description: | - Determines the horizontal alignment of the chat window. Behaves similarly - to `Class.UIGridStyleLayout.HorizontalAlignment`. Setting to `Left` or - `Right` adding a small padding away from touching the corresponding - horizontal edge of the screen. Setting to `Center` aligns the window in - the horizontal middle of the screen. Default value is `Left`. + Horizontal alignment of the chat window. Behaves similarly to + `Class.UIGridStyleLayout.HorizontalAlignment`. Setting to + `Enum.HorizontalAlignment|Left` or `Enum.HorizontalAlignment|Right` adding + a small padding away from touching the corresponding horizontal edge of + the screen. Setting to `Enum.HorizontalAlignment|Center` aligns the window + in the horizontal middle of the screen. Default value is + `Enum.HorizontalAlignment|Left`. code_samples: [] type: HorizontalAlignment tags: [] @@ -177,10 +174,10 @@ properties: can_save: true - name: ChatWindowConfiguration.TextColor3 summary: | - Determines the color of the text in default chat window. + Color of the text in default chat window. description: | - Determines the color of the text in default chat window. Default value is - `Datatype.Color3|Color3.new(255, 255, 255)` (white). + Color of the text in default chat window. Default value is + `Datatype.Color3|Color3.new(255, 255, 255)`. code_samples: [] type: Color3 tags: [] @@ -195,10 +192,9 @@ properties: can_save: true - name: ChatWindowConfiguration.TextSize summary: | - Determines the size of the text in default chat window. + Size of the text in default chat window. description: | - Determines the size of the text in default chat window. Default value - is 14. + Size of the text in default chat window. Default value is `14`. code_samples: [] type: int64 tags: [] @@ -213,10 +209,10 @@ properties: can_save: true - name: ChatWindowConfiguration.TextStrokeColor3 summary: | - Determines the color of the text stroke of text in default chat window. + Color of the text stroke for text in default chat window. description: | - Determines the color of the text stroke of text in default chat window. - Default value is `Datatype.Color3|Color3.new(0, 0, 0)` (black). + Color of the text stroke for text in default chat window. Default value is + `Datatype.Color3|Color3.new(0, 0, 0)`. code_samples: [] type: Color3 tags: [] @@ -231,11 +227,10 @@ properties: can_save: true - name: ChatWindowConfiguration.TextStrokeTransparency summary: | - Determines the transparency of the text stroke of text in default chat - window. + Transparency of the text stroke for text in default chat window. description: | - Determines the color of the text stroke of text in default chat window. - Default value is 0.5. + Transparency of the text stroke for text in default chat window. Default + value is `0.5`. code_samples: [] type: double tags: [] @@ -250,13 +245,15 @@ properties: can_save: true - name: ChatWindowConfiguration.VerticalAlignment summary: | - Determines the vertical alignment of the chat window. + Vertical alignment of the chat window. description: | - Determines the vertical alignment of the chat window. Behaves similarly to - `Class.UIGridStyleLayout.VerticalAlignment`. Setting to `Top` or `Bottom` - adds a small padding away from touching the corresponding edge of the - screen. Setting to Center aligns the window in the vertical middle of the - screen. Default value is `Top`. + Vertical alignment of the chat window. Behaves similarly to + `Class.UIGridStyleLayout.VerticalAlignment`. Setting to + `Enum.VerticalAlignment|Top` or `Enum.VerticalAlignment|Bottom` adds a + small padding away from touching the corresponding edge of the screen. + Setting to `Enum.VerticalAlignment|Center` aligns the window in the + vertical middle of the screen. Default value is + `Enum.VerticalAlignment|Top`. code_samples: [] type: VerticalAlignment tags: [] @@ -271,12 +268,11 @@ properties: can_save: true - name: ChatWindowConfiguration.WidthScale summary: | - Determines by what factor the width of the default chat window should be - scaled. + Factor by which the width of the default chat window should be scaled. description: | - Determines by what factor the width of the default chat window should be - scaled. Must be a value between 0.5 and 2. Defining a value outside of - range clamps the actual value to the closest bound. + Factor by which the width of the default chat window should be scaled. + Must be a value between `0.5` and `2`. Defining a value outside of range + clamps the actual value to the closest bound. code_samples: [] type: float tags: [] diff --git a/content/en-us/reference/engine/classes/TextChatMessageProperties.yaml b/content/en-us/reference/engine/classes/TextChatMessageProperties.yaml index 89879a501..b4ef3f9a0 100644 --- a/content/en-us/reference/engine/classes/TextChatMessageProperties.yaml +++ b/content/en-us/reference/engine/classes/TextChatMessageProperties.yaml @@ -9,16 +9,8 @@ summary: | description: | Overrides `Class.TextChatMessage` properties when returned by callbacks defined in `Class.TextChatService.OnIncomingMessage` or - `Class.TextChannel.OnIncomingMessage`. - - `Class.TextChatMessageProperties` overrides the matching properties of the - corresponding `Class.TextChatMessage`. - - This can be used to customize the appearance of a message with rich text tags. - See [Rich Text Markup](../../../ui/rich-text.md) for more. - - To learn more about using TextChatMessageProperties, see - [In-Experience Text Chat](../../../chat/customizing-in-experience-text-chat.md). + `Class.TextChannel.OnIncomingMessage`. This can be used to customize the + appearance of a message with [rich text](../../../ui/rich-text.md) tags. code_samples: [] inherits: - Instance @@ -60,8 +52,10 @@ properties: can_load: false can_save: false - name: TextChatMessageProperties.Translation - summary: '' - description: '' + summary: | + The `Class.TextChatMessage.Translation` to override. + description: | + The `Class.TextChatMessage.Translation` to override; represents [automatically translated](../../../production/localization/automatic-translations.md) and filtered text messages based on players' localization settings. code_samples: [] type: string tags: [] diff --git a/content/en-us/reference/engine/classes/UIDragDetector.yaml b/content/en-us/reference/engine/classes/UIDragDetector.yaml index cf881b6eb..28a5788fb 100644 --- a/content/en-us/reference/engine/classes/UIDragDetector.yaml +++ b/content/en-us/reference/engine/classes/UIDragDetector.yaml @@ -6,24 +6,24 @@ summary: | Instance which facilitates and encourages interaction with UI elements in an experience. description: | - The `Class.UIDragDetector` instance facilitates and encourages interaction - with 2D user interface elements in an experience, such as sliders and - spinners. Key features include: + The `UIDragDetector` instance facilitates and encourages interaction with 2D + user interface elements in an experience, such as sliders and spinners. Key + features include: - - Place a `Class.UIDragDetector` under any `Class.GuiObject` instance to make - it draggable via all inputs without a single line of code. + - Place a `UIDragDetector` under any `Class.GuiObject` instance to make it + draggable via all inputs without a single line of code. - Choose from several `Class.UIDragDetector.DragStyle|DragStyle` options, - define how the object responds to motion via - `Class.UIDragDetector.ResponseStyle|ResponseStyle`, and optionally apply - axis, movement limits, or drag boundaries. + define how the object responds to motion via + `Class.UIDragDetector.ResponseStyle|ResponseStyle`, and optionally apply axis, + movement limits, or drag boundaries. - Scripts can respond to manipulation of dragged objects to drive logic - responses, such as adjusting settings. + responses, such as adjusting settings. - - `Class.UIDragDetector|UIDragDetectors` work in Studio as long as you're - **not** using the **Select**, **Move**, **Scale**, or **Rotate** tools, nor - certain plugins or Studio's **UI** editor tools. + - `UIDragDetectors` work in Studio as long as you're **not** using the + **Select**, **Move**, **Scale**, or **Rotate** tools, nor certain plugins or + Studio's **UI** editor tools. code_samples: [] inherits: - UIComponent @@ -34,10 +34,10 @@ properties: - name: UIDragDetector.ActivatedCursorIcon summary: | Sets the cursor icon to display when the mouse is activated over the - parent of this `Class.UIDragDetector`. + parent of this `UIDragDetector`. description: | Sets the cursor icon to display when the mouse is activated over the - parent of this `Class.UIDragDetector`. If this property is left blank, the + parent of this `UIDragDetector`. If this property is left blank, the detector will use the default icon. To change the activated cursor icon, set this property to the asset ID of @@ -80,7 +80,7 @@ properties: Instance whose bounding area defines the drag boundaries for the parent `Class.GuiObject`. description: | - When set, the `Class.UIDragDetector` instance will not allow the bounds of + When set, the `UIDragDetector` instance will not allow the bounds of the parent `Class.GuiObject` to be dragged outside the bounds of the **BoundingUI** instance. @@ -104,10 +104,10 @@ properties: - name: UIDragDetector.CursorIcon summary: | Sets the cursor icon to display when the mouse is hovered over the parent - of this `Class.UIDragDetector`. + of this `UIDragDetector`. description: | Sets the cursor icon to display when the mouse is hovered over the parent - of this `Class.UIDragDetector`. If this property is left blank, the + of this `UIDragDetector`. If this property is left blank, the detector will use the default icon. To change the cursor icon, set this property to the asset ID of the image @@ -126,14 +126,14 @@ properties: can_save: true - name: UIDragDetector.DragAxis summary: | - The drag axis for the `Class.UIDragDetector` instance when + The drag axis for the `UIDragDetector` instance when `Class.UIDragDetector.DragStyle|DragStyle` is set to `Enum.UIDragDetectorDragStyle.TranslateLine`. description: | `Datatype.Vector2` value that defines the axis of movement for the dragged object when `Class.UIDragDetector.DragStyle|DragStyle` is set to `Enum.UIDragDetectorDragStyle.TranslateLine`. The axis is defined in the - local space of the `Class.UIDragDetector` unless + local space of the `UIDragDetector` unless `Class.UIDragDetector.ReferenceUIInstance|ReferenceUIInstance` is defined, in which case the axis is defined in that instance's local space. code_samples: [] @@ -185,7 +185,7 @@ properties: The rotation performed by the current drag. description: | The rotation performed by the current drag. This value is defined in - degrees relative to the local space of the `Class.UIDragDetector` unless + degrees relative to the local space of the `UIDragDetector` unless `Class.UIDragDetector.ReferenceUIInstance|ReferenceUIInstance` is defined, in which case the rotation is defined in the local space of that instance and from its positive **X** axis. @@ -285,9 +285,9 @@ properties: can_save: true - name: UIDragDetector.Enabled summary: | - Whether the `Class.UIDragDetector` responds to user input. + Whether the `UIDragDetector` responds to user input. description: | - If `true`, the `Class.UIDragDetector` responds to user input; if `false`, + If `true`, the `UIDragDetector` responds to user input; if `false`, it does not. code_samples: [] type: bool @@ -454,7 +454,7 @@ properties: description: | Once the proposed motion has been computed and potentially constrained, this paradigm is used to deterimine how to move (or not move) the - `Class.GuiObject` affected by the `Class.UIDragDetector`. See + `Class.GuiObject` affected by the `UIDragDetector`. See `Enum.UIDragDetectorResponseStyle` for options. code_samples: [] type: UIDragDetectorResponseStyle @@ -469,8 +469,14 @@ properties: can_load: true can_save: true - name: UIDragDetector.SelectionModeDragSpeed - summary: '' - description: '' + summary: | + Maximum drag speed for translation. + description: | + Defines the maximum drag speed for translation as a combination of + `Datatype.UDim.Scale|Scale` and `Datatype.UDim.Offset|Offset` of the first + ancestor `Class.ScreenGui` or `Class.SurfaceGui` the `UIDragDetector` + belongs to. This value must be positive and any value below `0` will be + clamped to `0`. code_samples: [] type: UDim2 tags: [] @@ -484,8 +490,12 @@ properties: can_load: true can_save: true - name: UIDragDetector.SelectionModeRotateSpeed - summary: '' - description: '' + summary: | + Maximum angle per second the `UIDragDetector` can rotate at. + description: | + Defines the maximum angle per second at which the `UIDragDetector` can + rotate. This value must be positive and any value below `0` will be + clamped to `0`. code_samples: [] type: float tags: [] @@ -499,8 +509,12 @@ properties: can_load: true can_save: true - name: UIDragDetector.UIDragSpeedAxisMapping - summary: '' - description: '' + summary: | + `Enum.UIDragSpeedAxisMapping` value that determines the **X**/**Y** + dimension dragging speeds. + description: | + `Enum.UIDragSpeedAxisMapping` value that determines the **X**/**Y** + dimension dragging speeds. code_samples: [] type: UIDragSpeedAxisMapping tags: [] diff --git a/content/en-us/reference/engine/enums/UIDragSpeedAxisMapping.yaml b/content/en-us/reference/engine/enums/UIDragSpeedAxisMapping.yaml index b31b44577..d746ab16a 100644 --- a/content/en-us/reference/engine/enums/UIDragSpeedAxisMapping.yaml +++ b/content/en-us/reference/engine/enums/UIDragSpeedAxisMapping.yaml @@ -1,23 +1,39 @@ name: UIDragSpeedAxisMapping type: enum -summary: '' -description: '' +summary: | + Used with `Class.UIDragDetector.UIDragSpeedAxisMapping` to determine the + **X**/**Y** dimension dragging speeds. +description: | + Used with `Class.UIDragDetector.UIDragSpeedAxisMapping` to determine the + **X**/**Y** dimension dragging speeds, based on the detector's + `Class.UIDragDetector.SelectionModeDragSpeed|SelectionModeDragSpeed`. code_samples: [] tags: [] deprecation_message: '' items: - name: XY - summary: '' + summary: | + Default setting for a detector's + `Class.UIDragDetector.UIDragSpeedAxisMapping|UIDragSpeedAxisMapping` where + the **X** and **Y** axis speeds are based off the **X** and **Y** + `Datatype.UDim.Scale|Scale`/`Datatype.UDim.Offset|Offset` values + respectively. value: 0 tags: [] deprecation_message: '' - name: XX - summary: '' + summary: | + Both the **X** and **Y** axis speeds are based off the **X** axis for + `Datatype.UDim.Scale|Scale`, while the `Datatype.UDim.Offset|Offset` + values still apply to their respective axis. value: 1 tags: [] deprecation_message: '' - name: YY - summary: '' + summary: | + Both the **X** and **Y** axis speeds are based off the **Y** axis for + `Datatype.UDim.Scale|Scale`, while the `Datatype.UDim.Offset|Offset` + values still apply to their respective axis. value: 2 tags: [] deprecation_message: '' diff --git a/content/en-us/ui/ui-drag-detectors.md b/content/en-us/ui/ui-drag-detectors.md index 86053cbcc..f5e55e3c3 100644 --- a/content/en-us/ui/ui-drag-detectors.md +++ b/content/en-us/ui/ui-drag-detectors.md @@ -161,6 +161,33 @@ By default, there are no limits to 2D motion behind the inherent restrictions of +### Speed Adjustments + +Through `Class.UIDragDetector.SelectionModeDragSpeed|SelectionModeDragSpeed` and `Class.UIDragDetector.SelectionModeRotateSpeed|SelectionModeRotateSpeed`, you can fine‑tune the maximum drag/rotate speeds for a detector. Furthermore, through `Class.UIDragDetector.UIDragSpeedAxisMapping|UIDragSpeedAxisMapping`, you can fine‑tune the **X**/**Y** dimension dragging speeds, based on the detector's `Class.UIDragDetector.SelectionModeDragSpeed|SelectionModeDragSpeed`. + + + + + + + + + + + + + + + + + + + + + + +
PropertyDescription
`Class.UIDragDetector.SelectionModeDragSpeed|SelectionModeDragSpeed`Defines the maximum drag speed for translation as a combination of `Datatype.UDim.Scale|Scale` and `Datatype.UDim.Offset|Offset` of the first ancestor `Class.ScreenGui` or `Class.SurfaceGui` the `Class.UIDragDetector` belongs to.
`Class.UIDragDetector.SelectionModeRotateSpeed|SelectionModeRotateSpeed`Defines the maximum angle per second at which the `Class.UIDragDetector` can rotate.
`Class.UIDragDetector.UIDragSpeedAxisMapping|UIDragSpeedAxisMapping`Determines the **X**/**Y** dimension dragging speeds, based on the detector's `Class.UIDragDetector.SelectionModeDragSpeed|SelectionModeDragSpeed`. The default is `Enum.UIDragSpeedAxisMapping.XY|XY`, meaning the **X** and **Y** axis speeds are based off the **X** and **Y** `Datatype.UDim.Scale|Scale`/`Datatype.UDim.Offset|Offset` values respectively.

Alternatives are `Enum.UIDragSpeedAxisMapping|XX` and `Enum.UIDragSpeedAxisMapping|YY`, meaning both the **X** and **Y** axis speeds are based off the **X** (`Enum.UIDragSpeedAxisMapping|XX`) or **Y** (`Enum.UIDragSpeedAxisMapping|YY`) axis for `Datatype.UDim.Scale|Scale`, while the `Datatype.UDim.Offset|Offset` values still apply to their respective axis. For example, if the first ancestor `Class.ScreenGui` is sized 800×600 and `Class.UIDragDetector.SelectionModeDragSpeed|SelectionModeDragSpeed` is `{0.1, 10}, {0.1, 20}`, a setting of `Enum.UIDragSpeedAxisMapping|XX` results in an **X**/**Y** drag speed of `80+10`/`80+20`, while `Enum.UIDragSpeedAxisMapping|YY` results in `60+10`/`60+20` (note the `Datatype.UDim.Offset|Offset` values remain the same in both cases).
+ ## Scripting Responses to Clicking and Dragging Through [event signals](#event-signals), property changes, `Enum.UIDragDetectorDragStyle.Scriptable|Scriptable` drag style, and custom functions, scripts can respond to the manipulation of dragged UI elements to drive various settings or make logical decisions, such as sliders that adjust music and sound effect volume separately.