Bytecrafter@legacy41529557 (talk | contribs) No edit summary |
Bytecrafter@legacy41529557 (talk | contribs) (Adding information about messageIds) |
||
(8 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
+ | {{widgetmethod}} |
||
− | <center>'''AddMessage''' ''-Documentation by Jason Citron, Additions by Dan Yankowsky-''</center> |
||
− | Outputs text to a |
+ | Outputs text to a MessageFrame in the specified color, for a specified amount of time. |
− | AddMessage(text, red, green, blue, |
+ | MessageFrame:AddMessage("text", red, green, blue, messageId, holdTime); |
---- |
---- |
||
;''Arguments'' |
;''Arguments'' |
||
− | :(String text, Number red, Number green, Number blue, Number |
+ | :(String text, Number red, Number green, Number blue, Number messageId, Number holdTime) |
:;text : The message to output |
:;text : The message to output |
||
− | :;red : The intensity of the red component. A |
+ | :;red : The intensity of the red component. A clamped float between 0.0 and 1.0 |
− | :;green : The intensity of the green component. A |
+ | :;green : The intensity of the green component. A clamped float between 0.0 and 1.0 |
− | :;blue : The intensity of the blue component. A |
+ | :;blue : The intensity of the blue component. 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. |
||
− | :;alpha : The opacity of the text. A number between 0.0 and 1.0 |
||
− | :;holdTime : |
+ | :;holdTime : length of time before the message fades out from the frame, in seconds |
---- |
---- |
||
Line 24: | Line 24: | ||
---- |
---- |
||
;''Example'' |
;''Example'' |
||
− | AddMessage("Testing", 1.0, 0.0, 0.0, |
+ | UIErrorsFrame:AddMessage("Testing", 1.0, 0.0, 0.0, 53, 5); |
;''Result'' |
;''Result'' |
||
− | Testing -- in red |
+ | Testing -- in red, fades out after 5 seconds, in message group 53 |
---- |
---- |
||
+ | ;''Description'' |
||
− | ==Escape Sequences== |
||
− | It is possible to control the text in the MessageFrame with escape sequences in text |
||
+ | 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. |
||
− | ===Set Color=== |
||
− | Syntax: |
||
− | |cAARRGGBB colored text |
||
− | Example: |
||
− | |cFFFF0000This Will Be In Red |
||
+ | If you call UpdateChatColor with messageId as an argument, you can change the color of a chat message dynamically. |
||
− | |||
− | ===Remove Color=== |
||
− | Syntax: |
||
− | |cAARRGGBB colored text |r uncolored text |
||
− | Example: |
||
− | |cFF00FF00In Green|rDefault Color |
||
− | |||
− | |||
− | ---- |
||
− | {{Template:WoW API}} |
Revision as of 15:06, 27 February 2010
The API is no longer being updated here until further notice. |
Outputs text to a MessageFrame in the specified color, for a specified amount of time.
MessageFrame:AddMessage("text", red, green, blue, messageId, holdTime);
- Arguments
- (String text, Number red, Number green, Number blue, Number messageId, Number holdTime)
- 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
- messageId
- A user-defined number that specifies which "color group" this message fits into. See the list of system-defined symbolic names. 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
- Returns
- nil
- Example
UIErrorsFrame:AddMessage("Testing", 1.0, 0.0, 0.0, 53, 5);
- Result
Testing -- in red, fades out after 5 seconds, in message group 53
- Description
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.