WoW:API ScrollingMessageFrame AddMessage: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
  <center>'''AddMessage''' ''-Documentation by Jason Citron, Allara, and Kremonte-''</center>
  <center>'''ScrollingMessageFrame:AddMessage''' ''-Documentation by Jason Citron and Allara, Fixes by Beladona-''</center><br/><br/>


Outputs text to a local frame in the specified color.
Outputs text to a local MessageFrame, with optional color id.
 
MessageFrame:AddMessage(text[,r,g,b[,id]]);


AddMessage(text, red, green, blue, id);


----
----
;''Arguments''
;''Arguments''


:(String text, Number red, Number green, Number blue, Number alpha, Number fade)
:(String text, Number red, Number green, Number blue, Number id)


:;text : The message to output
:;text : The string message to output
:;red : The intensity of the red component. A clamped float between 0.0 and 1.0
:;r : The intensity of the red component. A number between 0.0 and 1.0
:;green : The intensity of the green component. A clamped float between 0.0 and 1.0
:;g : The intensity of the green component. A number between 0.0 and 1.0
:;blue : The intensity of the blue component. A clamped float between 0.0 and 1.0
:;b : The intensity of the blue component. A number between 0.0 and 1.0
:;alpha : The alpha of the text. A clamped float between 0.0 and 1.0
:;id : A number that classifies the line of text, for later changing the color
:;fade : The time until the text fades. If nil, the text stays pinned until it gets scrolled down, or UI is reloaded.


----
----
Line 24: Line 24:
----
----
;''Example''
;''Example''
  AddMessage("Testing", 1.0, 0.0, 0.0, 0.5, 3);
  DEFAULT_CHAT_FRAME:AddMessage("Testing", 1.0, 0.0, 0.0, 1.0);


;''Result''
;''Result''
  Testing -- in red, half-opaque, and fades in 3 seconds
  Testing -- in red


----
----
;''Description''
==Escape Sequences==
Adds a message to a ScrollingMessageFrame.
It is possible to control the text in the MessageFrame with escape sequences in text
--[[User:Kremonte|Kremonte]] 04:25, 15 Dec 2005 (EST)
 
===Set Color===
Syntax:
|cAARRGGBB  colored text 
Example:
|cFFFF0000This Will Be In Red
 
 
===Remove Color===
Syntax:
|cAARRGGBB  colored text  |r  uncolored text
Example:
|cFF00FF00In Green|rDefault Color
 


----
----
{{Template:WoW API}}
{{Template:WoW API}}

Revision as of 22:43, 11 January 2006

ScrollingMessageFrame:AddMessage -Documentation by Jason Citron and Allara, Fixes by Beladona-



Outputs text to a local MessageFrame, with optional color id.

MessageFrame:AddMessage(text[,r,g,b[,id]]);



Arguments
(String text, Number red, Number green, Number blue, Number id)
text
The string message to output
r
The intensity of the red component. A number between 0.0 and 1.0
g
The intensity of the green component. A number between 0.0 and 1.0
b
The intensity of the blue component. A number between 0.0 and 1.0
id
A number that classifies the line of text, for later changing the color

Returns
nil

Example
DEFAULT_CHAT_FRAME:AddMessage("Testing", 1.0, 0.0, 0.0, 1.0);
Result
Testing -- in red

Escape Sequences

It is possible to control the text in the MessageFrame with escape sequences in text

Set Color

Syntax:

|cAARRGGBB  colored text  

Example:

|cFFFF0000This Will Be In Red


Remove Color

Syntax:

|cAARRGGBB  colored text  |r  uncolored text

Example:

|cFF00FF00In Green|rDefault Color



Template:WoW API