Text Colour In GUI Editor
by David Taylor · in Torque Game Builder · 03/21/2006 (7:56 pm) · 8 replies
I want to put text in a GUI I'm making. So I'm adding a new control: GuiTextCtrl, then adding text into the 'text' line under the 'General' heading. However, I can't actually see the text. This may well be because my background image is almost black in colour. How do I change the colour of the text? Or, if it isn't visible, how do I make it visible?
About the author
#2
gets copied and turned into
Good luck!
03/21/2006 (9:46 pm)
Typically, I go into profiles.cs (now found under common/gui). I find a similar Profile, in this case, GuiTextProfile. I copy those lines and name the profile something else (like MyGameGuiTextProfile). I change the color to something new. Most importantly, I then bring up the GUI editor and change the GuiTextProfile to MyGameGuiTextProfile.if(!isObject(GuiTextProfile)) new GuiControlProfile (GuiTextProfile)
{
fontColor = "0 0 0";
fontColorLink = "255 96 96";
fontColorLinkHL = "0 0 255";
autoSizeWidth = true;
autoSizeHeight = true;
};gets copied and turned into
if(!isObject(MyGameGuiTextProfile)) new GuiControlProfile (MyGameGuiTextProfile)
{
fontColor = "255 255 255";
fontColorLink = "255 96 96";
fontColorLinkHL = "0 0 255";
autoSizeWidth = true;
autoSizeHeight = true;
};Good luck!
#3
Now, is there any way to change the size or type of the font?
03/21/2006 (10:08 pm)
Thanks, William. That works a treat. :)Now, is there any way to change the size or type of the font?
#4
03/22/2006 (7:42 am)
There is! There are two more attributes you can put into the profile: fontType and fontSize.if(!isObject(MyGameGuiTextProfile)) new GuiControlProfile (MyGameGuiTextProfile)
{
fontType = "Tubular";
fontSize = 28;
fontColor = "255 255 255";
fontColorLink = "255 96 96";
fontColorLinkHL = "0 0 255";
autoSizeWidth = true;
autoSizeHeight = true;
};
#5
Is there a list of the font types somewhere?
03/22/2006 (10:39 am)
Thanks! You guys are brilliant! :)Is there a list of the font types somewhere?
#6
03/22/2006 (4:54 pm)
Anything installed on your computer will work. As a bonus, the engine creates a "cache" of the fonts you use. Therefore, if you've run the game at least once using a given font and size, you don't need to install the font on your users' computer.
#7
Hi and merry christmas before my question! ;)
I´ve tried just as you suggest below:
And when I open the GUI builder the new profile is not available to use in my GuiTextCrtl... what can be wrong?
Thanks!
Isaac
12/28/2009 (1:07 pm)
William,Hi and merry christmas before my question! ;)
I´ve tried just as you suggest below:
if(!isObject(MyGameGuiTextProfile)) new GuiControlProfile (MyGameGuiTextProfile)
{
fontType = "Tubular";
fontSize = 28;
fontColor = "255 255 255";
fontColorLink = "255 96 96";
fontColorLinkHL = "0 0 255";
autoSizeWidth = true;
autoSizeHeight = true;
};And when I open the GUI builder the new profile is not available to use in my GuiTextCrtl... what can be wrong?
Thanks!
Isaac
#8
12/28/2009 (3:37 pm)
The only think I can think of right now is to make sure that this is in the "gameScripts/guiProfiles.cs" file.
Torque Owner David Taylor
www.garagegames.com/mg/forums/result.thread.php?qt=28026
But how exactly do I do what the second poster has suggested?