The API is no longer being updated here until further notice. |
Outputs text to a local MessageFrame, with optional color id.- Updated in 2.4.2
MessageFrame:AddMessage(text [, r, g, b, id, addToStart])
Arguments[]
- text
- string - Message to output
- r
- number? - Red font color component between 0.1 and 1.0.
- g
- number? - Green font color component between 0.1 and 1.0.
- b
- number? - Blue font color component between 0.1 and 1.0.
- id
- number? - Identifies the line of text for later accessing it.
- addToStart
- boolean - True to add the message to the start of the MessageFrame as if it were the first printed message.
Details[]
DEFAULT_CHAT_FRAME
refers to the current default chat window.- UI Escape Sequences are often applied to style the text or insert hyperlinks.
Examples[]
Outputs "Testing" on in red to the default chat window:
DEFAULT_CHAT_FRAME:AddMessage("Testing", 1.0, 0.0, 0.0);
Outputs "AddOn Loaded!" in green at the start of the default chat window:
DEFAULT_CHAT_FRAME:AddMessage("AddOn Loaded!", 0.0, 1.0, 0.0, nil, true);
Styles the text using UI Escape Sequences:
DEFAULT_CHAT_FRAME:AddMessage("Look at this: messages can be |cffff0000red|r and |cff00ff00green|r!");
Patch changes[]
- Patch 2.4.2 (2008-05-13):
addToStart
argument added.