WoW:API MessageFrame AddMessage: Difference between revisions

m
Move page script moved page API MessageFrame AddMessage to WoW:API MessageFrame AddMessage without leaving a redirect
No edit summary
m (Move page script moved page API MessageFrame AddMessage to WoW:API MessageFrame AddMessage without leaving a redirect)
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<center>'''MessageFrame:AddMessage''' ''-Documentation by Jason Citron, Additions by Dan Yankowsky, Fixes by Beladona-''</center><br/><br/>
{{widgetmethod}}
 


Outputs text to a MessageFrame in the specified color, for a specified amount of time.
Outputs text to a MessageFrame in the specified color, for a specified amount of time.


  MessageFrame:AddMessage("text", red, green, blue, alpha, holdTime);
  MessageFrame:AddMessage("text", red, green, blue, messageId, holdTime);


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


:(String text, Number red, Number green, Number blue, Number alpha, Number holdTime)
:(String text, Number red, Number green, Number blue, Number messageId, Number holdTime)


:;text : The message to output
:;text : The message to output
Line 15: 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
:;alpha : The level of alpha opacity. A clamped float between 0.0 and 1.0
:;messageId : A user-defined number that specifies which "color group" this message fits into. See the [[ChatTypeInfo|list of system-defined symbolic names]]. [[API GetChatTypeIndex|GetChatTypeIndex]] can be used to turn a symbolic name into an integer index.
:;holdTime : length of time before the message fades out from the frame, in seconds
:;holdTime : length of time before the message fades out from the frame, in seconds


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


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


----
----
Line 35: Line 34:
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.
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.


----
If you call UpdateChatColor with messageId as an argument, you can change the color of a chat message dynamically.
{{Template:WoW API}}
Anonymous user