MessageFrame:AddMessage
Jump to navigation
Jump to search
Outputs text to a MessageFrame in the specified color.
MessageFrame:AddMessage(text [, colorR, colorG, colorB, a, messageID])
Arguments
- text
- string - The message to output
- colorR
- number?
[0.0 - 1.0]
- The intensity of the red component. - colorG
- number?
[0.0 - 1.0]
- The intensity of the green component. - colorB
- number?
[0.0 - 1.0]
- The intensity of the blue component. - a
- number?
[0.0 - 1.0]
- The opacity of the message.0
is fully transparent,1
is fully opaque. - messageID
- number? - A user-defined number that specifies which "color group" this message fits into. See the list of system-defined symbolic names. GetChatTypeIndex() can be used to turn a symbolic name into an integer index.
Details
- If you call UpdateChatColor with messageId as an argument, you can change the color of a chat message dynamically.
Example
Prints a red colored message to the UI error frame with 50% opacity.
/run UIErrorsFrame:AddMessage("Hello world", 1, 0, 0, .5)