Ansu2865@legacy41524303 (talk | contribs) |
MentalPower (talk | contribs) (Factual correction) |
||
Line 7: | Line 7: | ||
==Supported Escape Sequences== |
==Supported Escape Sequences== |
||
− | ;<tt>|c''AA<font color=red>RR</font><font color=green>GG</font><font color=blue>BB</font>''</tt>: Sets text color. Text following this escape sequence will be drawn in this color. Each pair of digits represents a color value (plus the alpha value) as a hexadecimal number. |
+ | ;<tt>|c''AA<font color=red>RR</font><font color=green>GG</font><font color=blue>BB</font>''</tt>: Sets text color. Text following this escape sequence will be drawn in this color. Each pair of digits represents a color value (plus the alpha value, however the alpha value is currently ignored and should always be FF) as a hexadecimal number. |
:* |cFFFF0000 - Red text |
:* |cFFFF0000 - Red text |
||
:* |cFF00FF00 - Green text |
:* |cFF00FF00 - Green text |
Revision as of 20:02, 25 April 2008
The API is no longer being updated here until further notice. |
Main Menu |
---|
|
Many UI elements that display text on the screen support a special escape sequence.
Most likely to prevent interference with the C / LUA escape sequences, Blizzard decided to start those sequences with the pipe character (|).
Supported Escape Sequences
- |cAARRGGBB
- Sets text color. Text following this escape sequence will be drawn in this color. Each pair of digits represents a color value (plus the alpha value, however the alpha value is currently ignored and should always be FF) as a hexadecimal number.
- |cFFFF0000 - Red text
- |cFF00FF00 - Green text
- |cFF0000FF - Blue text
- |cFFFFFF00 - Yellow text
- etc.
- |r
- Reset the color, all text following this sequence will be drawn in the default color of the text.
- |Hlinkid|hLinktext|h
- for Hyperlinks, while the only currently known links are item, enchant, quest and player links.
- |Hitem:ItemID|hLinktext|h
- for Item Links (ItemID must be the full Item-Id, ie. d:d:d:d:d:d:d:d style)
- |Henchant:EnchantID|hLinktext|h
- for Enchant Links
- |Hplayer:Name|hLinktext|h
- for Player Links (Click to whisper, CTRL-Click to select and Shift-Click to do a /Who Name)
- |Hquest:QuestID|hLinktext|h
- for Quest links.
- |n
- Possibly as newline in some cases.
- number |1singular;plural;
- Will choose a word depending on whether the number preceding it is 1 or not.
- |TTexturePath:width:height:xoffset:yoffset|t
- Will insert a texture into a font string. If height is omitted, it will match the width to create a square. The offsets are optional and will shift the texture from where it would normally be placed.
- ||
- Output "|" regardless of if whatever follows it looks like a valid escape.
A "|" followed by something that is not a valid escape sequence will be displayed as-is.
Examples
Text color
|cFFFF0000This is red text |rthis is normal color
Should result in
This is red text this is normal color
Note that color here is 4-channel (aarrggbb).
Gotchas
If you are using an in-game text editor, it is not wholly unlikely that the editor is trying to being "helpful" by replacing "|" with "||" for you without you seeing it. If you are trying to use escape sequences and just keep getting pipe chars, that's why. Try using "\124" instead of "|". 124 is the ascii code escape for the pipe character, and will work regardless of what your editor is trying to do.