wowpedia
Main Menu


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?Optional. Could be nil. - Red font color component between 0.1 and 1.0.
g
number?Optional. Could be nil. - Green font color component between 0.1 and 1.0.
b
number?Optional. Could be nil. - Blue font color component between 0.1 and 1.0.
id
number?Optional. Could be nil. - 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

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