WoW:API MessageFrame AddMessage: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 1: Line 1:
  <center>'''AddMessage''' ''-Documentation by Jason Citron, Additions by Dan Yankowsky-''</center>
  <center>'''MessageFrame:AddMessage''' ''-Documentation by Jason Citron, Additions by Dan Yankowsky, Fixes by Beladona-''</center><br/><br/>


Outputs text to a local frame in the specified color.


  AddMessage(text, red, green, blue, alpha, holdTime);
Outputs text to a MessageFrame in the specified color, for a specified amount of time.
 
  MessageFrame:AddMessage("text", red, green, blue, alpha, holdTime);


----
----
Line 11: Line 12:


:;text : The message to output
:;text : The message to output
:;red : The intensity of the red component. A number between 0.0 and 1.0
:;red : The intensity of the red component. A clamped float between 0.0 and 1.0
:;green : The intensity of the green 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
:;blue : The intensity of the blue 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
:;alpha : The opacity of the text. A number between 0.0 and 1.0
:;alpha : The level of alpha opacity. A clamped float between 0.0 and 1.0
:;holdTime : Time in seconds before the message fades.
:;holdTime : length of time before the message fades out from the frame, in seconds


----
----
Line 24: Line 25:
----
----
;''Example''
;''Example''
  AddMessage("Testing", 1.0, 0.0, 0.0, 1.0, 5);
  UIErrorsFrame:AddMessage("Testing", 1.0, 0.0, 0.0, 1.0, 5);


;''Result''
;''Result''
  Testing -- in red
  Testing -- in red, fades out after 5 seconds


----
----
==Escape Sequences==
;''Description''
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


Any of the parameters after text are optional. The hold time should also be set however, otherwise the message will remain within the ScrollingMessageFrame until it is scrolled up past the lines specified in the frame, or until you exit the game.


----
----
{{Template:WoW API}}
{{Template:WoW API}}
Anonymous user