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 and Allara-''</center>
  <center>'''AddMessage''' ''-Documentation by Jason Citron, Allara, and Kremonte-''</center>


Outputs text to a local frame in the specified color.
Outputs text to a local frame in the specified color.
Line 8: Line 8:
;''Arguments''
;''Arguments''


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


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


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


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


----
----
;''Description''
;''Description''
 
Adds a message to a ScrollingMessageFrame.
Any of the parameters after text are optional. ID is used internally by the chat system, in order to provide a way to later customize the color of specific lines in the chat window. By tying each type of chat to a unique ID, the ColorPicker's colorFunc can use UpdateColorByID to dynamically change the color of the lines. There does not appear to be a way to influence the alpha of chat lines, or to change or duplicate the behavior of the ScrollingMessageFrame's fading out ability. --[[User:Allara|Allara]] 02:38, 16 May 2005 (EDT)
--[[User:Kremonte|Kremonte]] 04:25, 15 Dec 2005 (EST)


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

Revision as of 21:39, 15 December 2005

AddMessage -Documentation by Jason Citron, Allara, and Kremonte-

Outputs text to a local frame in the specified color.

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

Arguments
(String text, Number red, Number green, Number blue, Number alpha, Number fade)
text
The message to output
red
The intensity of the red component. A clamped float between 0.0 and 1.0
green
The intensity of the green component. A clamped float between 0.0 and 1.0
blue
The intensity of the blue component. A clamped float between 0.0 and 1.0
alpha
The alpha of the text. A clamped float between 0.0 and 1.0
fade
The time until the text fades. If nil, the text stays pinned until it gets scrolled down, or UI is reloaded.

Returns
nil

Example
AddMessage("Testing", 1.0, 0.0, 0.0, 0.5, 3);
Result
Testing -- in red, half-opaque, and fades in 3 seconds

Description

Adds a message to a ScrollingMessageFrame. --Kremonte 04:25, 15 Dec 2005 (EST)


Template:WoW API