• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Coloured Text

Status
Not open for further replies.
Level 2
Joined
Dec 23, 2007
Messages
10
Hi im new and i have one question.
How i can make coloured text.
Text Like on Dota when you kill the hero.
On this text players have their normal colours.

"Player 1 has pawned Player 2's head for an extra 100 gold."

This is something like that but i wanna add custom name of player ;).
Pla show me triggers to that thing ^^.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
help him instead?

you use it like this:

|CFF"colorcode"hay|r, e.g |CFF0303hay|r would be

hay

That's actually a wrong code and it will not work probably.

Its RRGGBB with the cff having nothing to do with the code, to put a pure red you'll need |cffff0000 this is red |r.

Every code is started with |cff , ends with |r and has between the hexadecimal color code which is represented by RRGGBB (red, red, green, green, blue, blue). Each of this letters could be placed with something between 0 and f (0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f) with 0 being nothing and f being the maximum, of course.

That's all there is for hexa colors.
 
Level 7
Joined
Jul 20, 2008
Messages
377
@OP:

If you intend to prevent players from choosing their color in-game, there is an easy way to prepare this. Just make a string array with each value correlating to each player slot and fill them in with player names colored.

For example:
playerstring[0]=red colored player 1's name
playerstring[1]=blue colored player 2's name
etc.

And then when the time comes for you to put these into action, you can just use (Player Number - 1) in GUI to get the right slot in the array. I say minus one because GUI is weird and starts counting player numbers from 1, whereas JASS starts from 0.
 
Level 7
Joined
Jul 20, 2008
Messages
377
I just don't like to waste the 0th slot in arrays, even when I used to use GUI. :\
 
Status
Not open for further replies.
Top