You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en-us/chat/bubble-chat.md
+12-6Lines changed: 12 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
1
---
2
-
title: Bubble Chat
2
+
title: Customizing Bubble Chat
3
3
description: The text chat system allows users to communicate and socialize with each other.
4
4
---
5
5
6
-
With the [in-experience text chat](../chat/in-experience-text-chat.md) system, you can support**bubble chat** to display customizable speech chat bubbles above user avatars and NPCs. Bubble chat can make your experience more visually immersive and help users easily identify messages and their speakers in a contextually relevant manner. This feature is especially useful for experiences where users need to focus on the content in the meantime communicating with others in a less obtrusive way.
6
+
With [TextChatService](../chat/in-experience-text-chat.md), you can use**bubble chat** to display customizable speech chat bubbles above user avatars and NPCs. Bubble chat can make your experience more visually immersive and help users easily identify messages and their speakers in a contextually relevant manner. This feature is especially useful for experiences where users need to focus on the content in the meantime communicating with others in a less obtrusive way.
Alternatively, you can add a `Class.LocalScript` in `Class.StarterPlayerScripts` with all your customization settings. This allows the engine to apply your customizations during runtime, overriding the settings in Studio. It's useful for adding special effects to chat bubbles when users trigger certain events or conditions.
28
+
Alternatively, add a `Class.LocalScript` in `Class.StarterPlayerScripts` with all your customization settings. This allows the engine to apply your customizations during runtime, overriding the settings in Studio. It's useful for adding special effects to chat bubbles when users trigger certain events or conditions.
29
29
30
30
### Basic Customization
31
31
@@ -323,7 +323,7 @@ The following tables outline the available `Class.GuiObject` and [appearance mod
323
323
324
324
## Per-Bubble Customization
325
325
326
-
You can individually style and modify chat bubble behaviors based on specific conditions that overrides your general settings. For example, you can use chat bubbles to differentiate NPCs and users, highlight critical health status, and apply special effects to messages with pre-defined keywords.
326
+
You can individually style and modify chat bubble behaviors based on specific conditions in order to override your general settings. For example, you can use chat bubbles to differentiate NPCs and users, highlight critical health status, and apply special effects to messages with pre-defined keywords.
327
327
328
328
To set per-bubble customization, add a client-side `Class.LocalScript` using `Class.BubbleChatMessageProperties`, which overrides matching properties of `Class.BubbleChatConfiguration`, and the `Class.TextChatService.OnBubbleAdded` callback to specify how to customize each bubble. The callback supplies you with the `Class.TextChatMessage` property as well as the adornee, so you can apply the customization based on attributes associated with users, the chat text content, user character properties, and any special conditions you want to define.
You can display chat bubbles for non-player characters (NPCs) by calling `Class.TextChatService:DisplayBubble()`, with the NPC character and the message as parameters. These bubbles are customizable using the `Class.TextChatService.OnBubbleAdded` callback just like any other chat bubble.
440
+
You might want to display a chat bubble when players haven't sent a message, such as with NPCs. Use the `Class.TextChatService:DisplayBubble` method to manually display a chat bubble.
441
+
442
+
Customization of these bubbles is the same as the customization of the bubbles that are automatically displayed when Players send messages through TextChannels using the [`Class.TextChatService.OnBubbleAdded` callback](#per-bubble-customization).
443
+
444
+
### NPC Bubbles
445
+
446
+
Display chat bubbles for non-player characters (NPCs) by calling `Class.TextChatService:DisplayBubble(character, message)`, with the NPC character and the message as parameters. These bubbles are customizable using the `Class.TextChatService.OnBubbleAdded` callback just like any other chat bubble.
441
447
442
448
`Class.TextChatService:DisplayBubble()` only works on client-side scripts, so be sure to use a `Class.Script` with `Class.BaseScript.RunContext|RunContext` set to `Enum.RunContext.Client`, or a `Class.LocalScript` in an [appropriate container](/projects/data-model#client), such as `Class.StarterPlayerScripts`. If you attach a `Class.ProximityPrompt` to an NPC, a script for displaying a chat bubble might look like this:
Copy file name to clipboardExpand all lines: content/en-us/chat/chat-window.md
+154-9Lines changed: 154 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: Customizing Text Chat
2
+
title: Customizing the Chat Window
3
3
description: Customize the chat window and message UI of your in-experience text chat.
4
4
---
5
5
@@ -11,16 +11,16 @@ The overall chat window consists of the **chat window**, an **input bar**, and o
11
11
12
12
<imgsrc="../assets/players/in-experience-text-chat/Chat-Window-Components.jpg"width="800"alt="Core components of the text chat window." />
13
13
14
-
The channel tabs are disabled by default and each component can be toggled on/off in Studio or through scripting:
14
+
The channel tabs are disabled by default and each component can be toggled on and off in Studio or through scripting:
15
15
16
16
<Tabs>
17
17
<TabItemlabel="Studio">
18
-
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.
18
+
In the [Explorer](../studio/explorer.md) window, expand the `Class.TextChatService` branch and select `Class.ChatWindowConfiguration`, `Class.ChatInputBarConfiguration`, or `Class.ChannelTabsConfiguration`. Then enable or disable the component in the [Properties](../studio/properties.md) window.
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.
49
+
When `Class.ChannelTabsConfiguration` is enabled, each **default**`Class.TextChannel`appears in a tab as outlined in the following table. In addition, each **custom**`Class.TextChannel`creates a tab corresponding to the channel's `Class.Instance.Name|Name` property.
50
50
51
51
<tablesize="small">
52
52
<thead>
@@ -70,7 +70,7 @@ When `Class.ChannelTabsConfiguration` is enabled, each **default** `Class.TextCh
70
70
</tr>
71
71
<tr>
72
72
<td>**RBXWhisper**</td>
73
-
<td>User name of other player</td>
73
+
<td>User name of the other player</td>
74
74
</tr>
75
75
</tbody>
76
76
</table>
@@ -284,7 +284,7 @@ Appearance of the **channel tabs** is customizable through `Class.ChannelTabsCon
284
284
You can customize the appearance of chat message bodies and prefixes using `Class.ChatWindowMessageProperties` and `Class.TextChatService.OnChatWindowAdded` 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 and coloring prefixes.
285
285
286
286
<Alertseverity="info">
287
-
`Class.ChatWindowMessageProperties` and `Class.TextChatService.OnChatWindowAdded|OnChatWindowAdded`will only affect the appearance of messages in the chat window. To customize chat bubbles, see [Bubble Chat](../chat/bubble-chat.md).
287
+
`Class.ChatWindowMessageProperties` and `Class.TextChatService.OnChatWindowAdded|OnChatWindowAdded` only affect the appearance of messages in the chat window. To customize chat bubbles, see [Bubble Chat](../chat/bubble-chat.md).
288
288
</Alert>
289
289
290
290
### Coloring User Names
@@ -415,11 +415,11 @@ end
415
415
416
416
## Sending Messages from Non‑Player Sources
417
417
418
-
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.
418
+
Sometimes, you might want to show non‑player dialogue in the chat window, such as "speech" from a public address system or a non‑player character.
419
419
420
420
### System
421
421
422
-
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.
422
+
To deliver a system message to the local player, call `Class.TextChannel:DisplaySystemMessage()|DisplaySystemMessage()` from the default **RBXGeneral** channel with a prefix before the player's display name.
<imgsrc="../assets/players/in-experience-text-chat/Chat-System.jpg"width="800"alt="Image showing a basic system message in the chat window." />
438
438
439
+
For a more detailed guide on how to customize the appearance of system messages, see [Customizing System Messages](./examples/custom-system-messages.md).
440
+
441
+
#### Default System Messages
442
+
443
+
When `Class.TextChatService.CreateDefaultTextChannels` is true, one of the default text channels is the **RBXSystem** channel. The default chat scripts automatically display system messages in this channel. You can customize the appearance of these messages using the `Class.TextChannel.OnIncomingMessage` callback.
444
+
445
+
You might want to customize or alter the system messages that are automatically emitted by the chat system. Since the default system messages are localized for users, you should reference them by `TextChatMessage.Metadata` in your [text chat callbacks](../chat/in-experience-text-chat.md#text-chat-hooks-and-callbacks) if you wish to customize their appearance.
446
+
447
+
Below is a reference of the default system messages that are emitted by the chat system:
<td>An error response from the RBXUnmuteCommand TextChatCommand</td>
576
+
</tr>
577
+
<tr>
578
+
<td><b>Roblox.Unmute.Info.Success</b></td>
579
+
<td>An success response from the RBXUnmuteCommand TextChatCommand</td>
580
+
</tr>
581
+
</tbody>
582
+
</table>
583
+
439
584
### NPC/Object
440
585
441
586
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.
0 commit comments