在 TextChatService.OnIncomingMessage 或 TextChannel.OnIncomingMessage 中定義的回調中返回過載 TextChatMessage 屬性時。這可以用來自訂訊息的外觀標籤 富文本 標籤。
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 。