HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Adding colored text to a map

05-19-2002, 03:33 PM#1
Guest
In Warcraft II and in Starcraft, there were specific ascii symbols that you could place before a line of text to make it change color, giving you about 6 or 7 choices of what you wanted t a line's color to be. The bad news is, these characters do not work anymore. The good news is, with the right hard coding, you can change the color of text to ANY color within the range of colors given by HTML code. So you can make your text any color of the rainbow if you like.

I discovered this while looking through the unit editor. Under most units' tooltips, they have a tooltip that says something like "Train |cffffcc00P|reasant". This gobbledegook seems to make no sense until you realize that in the game screen, it shows "Train Peasant", with the P a different color because that is the hotkey for a unit.

After some experimentation, I found a way to make this code work in any area in Warcraft III where there is text. All you have to do is add a prefix to the text, put in an HTML code, and the text changes color. The prefix is |c00, followed by a 6-digit HTML color code. (In actuality, you can probably use any hexidecimal number in the prefix 00, but 00 seems to make a good match for the html colors.) Thus, if you wanted the text to be red (with html color #aa0000) you would type "|c00aa0000any text you want". I believe the |r function is simply a call to return the text back to normal.
05-19-2002, 06:01 PM#2
Guest
nice works fine :)