From d1712144a92776d1a55c795ce9a28f0a0a1f6a28 Mon Sep 17 00:00:00 2001 From: foshesss Date: Sun, 9 Mar 2025 22:55:09 -0400 Subject: [PATCH 1/2] added documentation for deriving textchatmessageproperties --- .../classes/TextChatMessageProperties.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/content/en-us/reference/engine/classes/TextChatMessageProperties.yaml b/content/en-us/reference/engine/classes/TextChatMessageProperties.yaml index 8de9b7501..7a0cc9260 100644 --- a/content/en-us/reference/engine/classes/TextChatMessageProperties.yaml +++ b/content/en-us/reference/engine/classes/TextChatMessageProperties.yaml @@ -11,6 +11,23 @@ description: | defined in `Class.TextChatService.OnIncomingMessage` or `Class.TextChannel.OnIncomingMessage`. This can be used to customize the appearance of a message with [rich text](../../../ui/rich-text.md) tags. + + ```lua title='LocalScript - Retrieving and Using TextChatMessageProperties' + local TextChatService = game:GetService("TextChatService") + TextChatService.OnIncomingMessage = function(message: TextChatMessage) + -- deriving TextChatMessageProperties + local properties = TextChatService.ChatWindowConfiguration:DeriveNewMessageProperties() + + -- changing color of messsage + properties.TextColor3 = Color3.fromRGB(255, 121, 121) + + -- setting message's chatwindowmessageproperties + message.ChatWindowMessageProperties = properties + + return properties + end + ``` + code_samples: [] inherits: - Instance From c534cc22ff63dd7b55314f6e4002ef8cf4b2f320 Mon Sep 17 00:00:00 2001 From: foshes <80663171+foshesss@users.noreply.github.com> Date: Thu, 13 Mar 2025 13:36:23 -0400 Subject: [PATCH 2/2] Update content/en-us/reference/engine/classes/TextChatMessageProperties.yaml Co-authored-by: IgnisRBX <43388550+IgnisRBX@users.noreply.github.com> --- .../classes/TextChatMessageProperties.yaml | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/content/en-us/reference/engine/classes/TextChatMessageProperties.yaml b/content/en-us/reference/engine/classes/TextChatMessageProperties.yaml index 7a0cc9260..3fcc27552 100644 --- a/content/en-us/reference/engine/classes/TextChatMessageProperties.yaml +++ b/content/en-us/reference/engine/classes/TextChatMessageProperties.yaml @@ -14,20 +14,19 @@ description: | ```lua title='LocalScript - Retrieving and Using TextChatMessageProperties' local TextChatService = game:GetService("TextChatService") + TextChatService.OnIncomingMessage = function(message: TextChatMessage) - -- deriving TextChatMessageProperties - local properties = TextChatService.ChatWindowConfiguration:DeriveNewMessageProperties() - - -- changing color of messsage - properties.TextColor3 = Color3.fromRGB(255, 121, 121) - - -- setting message's chatwindowmessageproperties - message.ChatWindowMessageProperties = properties - - return properties + -- Derive chat message properties + local properties = TextChatService.ChatWindowConfiguration:DeriveNewMessageProperties() + + -- Change color of message + properties.TextColor3 = Color3.fromRGB(255, 121, 121) + + -- Set chat window message properties + message.ChatWindowMessageProperties = properties + + return properties end - ``` - code_samples: [] inherits: - Instance