Skip to content

Commit d171214

Browse files
committed
added documentation for deriving textchatmessageproperties
1 parent a47fd3a commit d171214

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

content/en-us/reference/engine/classes/TextChatMessageProperties.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,23 @@ description: |
1111
defined in `Class.TextChatService.OnIncomingMessage` or
1212
`Class.TextChannel.OnIncomingMessage`. This can be used to customize the
1313
appearance of a message with [rich text](../../../ui/rich-text.md) tags.
14+
15+
```lua title='LocalScript - Retrieving and Using TextChatMessageProperties'
16+
local TextChatService = game:GetService("TextChatService")
17+
TextChatService.OnIncomingMessage = function(message: TextChatMessage)
18+
-- deriving TextChatMessageProperties
19+
local properties = TextChatService.ChatWindowConfiguration:DeriveNewMessageProperties()
20+
21+
-- changing color of messsage
22+
properties.TextColor3 = Color3.fromRGB(255, 121, 121)
23+
24+
-- setting message's chatwindowmessageproperties
25+
message.ChatWindowMessageProperties = properties
26+
27+
return properties
28+
end
29+
```
30+
1431
code_samples: []
1532
inherits:
1633
- Instance

0 commit comments

Comments
 (0)