在 TextChatMessage 或 TextChatService.OnIncomingMessage 或 TextChannel.OnIncomingMessage 中定义的回调返回时覆盖属性 或 。这可用于自定义具有 富文本标签 的消息的外观。
local TextChatService = game:GetService("TextChatService")
TextChatService.OnIncomingMessage = function(message: TextChatMessage)
-- 派生聊天消息属性
local properties = TextChatService.ChatWindowConfiguration:DeriveNewMessageProperties()
-- 更改消信息的颜色
properties.TextColor3 = Color3.fromRGB(255, 121, 121)
-- 设置聊天窗口消息属性
message.ChatWindowMessageProperties = properties
return properties
end
概要
属性
需要覆盖的 TextChatMessage.PrefixText 。
需要覆盖的 TextChatMessage.Text 。
需要覆盖的 TextChatMessage.Translation 。