Chat Font/Color
by none · in Torque Game Engine · 08/15/2010 (1:14 am) · 3 replies
I'm almost done with my in-game GUI, however, I want to change the color and font for the chat GUI. The problem is, I've looked through all of the scripts and cannot find where these things are scripted/coded. I would also like to change what the messages say if possible. Thanks for help!
#2
Use the escape char followed by a color code immediately followed by your message text.
Message types are setup/prepared in message.cs (both server & client side).
You can also use colorcodes in messages echo'd to the console:
The following is quick little script so you can see the various available colors for use in the chatHud and console.
08/16/2010 (8:18 am)
Overall GuiControl or HUD fonts & colors are controlled by scripted profiles, but the chatHud is a special case in which you can display certain colors irrespective of whatever profile is used.Use the escape char followed by a color code immediately followed by your message text.
messageClient(%this, 'MsgClientJoin', '\c2Now leaving the mission area!');That will display a message in the chathud with the \c2 color -- I'm colorblind so I can't say what that color is :D
Message types are setup/prepared in message.cs (both server & client side).
You can also use colorcodes in messages echo'd to the console:
echo (%game @"\c4 -> "@ %game.class @" -> GameCore::preparePlayer");
The following is quick little script so you can see the various available colors for use in the chatHud and console.
function messageColorTest()
{
messageAll('MsgTestColors', '\c0Color 0 \c1Color 1 \c2Color 2 \c3 Color 3 \c4 Color 4 \c5 Color 5 \c6 Color 6 \c7Color 7 \c8 Color 8 \c9 Color 9');
echo("\c0test \c1test \c2test \c3test \c4test \c5test \c6test \c7test \c8test \c9test");
}
#3
08/16/2010 (8:51 pm)
Awesome! Thanks guys!
Torque 3D Owner Thomas Bang
Each GUI-Object uses a special GuiProfile. Look for the "profile"-property. If you want a different font color (and/or other different properties) for the chat, you have to create a new profile.