Text Colour In GUI Editor
by David Taylor · in Torque Game Builder · 03/21/2006 (7:56 pm) · 10 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.
#9
07/14/2013 (8:22 pm)
Ok I hate to say this but I am a complete noob to all this kind of stuff. I have been assigned a task to create the GUI for a pc game me and a buddy are trying to create. So far I have 2 buttons created. Both are GuiIconButtonCtrl so that I can use an image as my buttons. Only thing is the text in my buttons is hard to read for two reasons. 1. Color and 2. size. My question is; how do I get to my games guiProfiles.cs? I'm not sure if I am just this dumb or if I am really missing it lol. Thanks.
#10
In Torque 2D you'll find the base profiles in modules/Sandbox/1/gui/guiProfiles.cs
The easiest way to find your primary profiles script (in Torsion) is to use ctrl-shift-f to search the project for (GuiDefaultProfile - don't forget the parenthesis at the beginning or you'll get a ton of hits.
07/14/2013 (10:30 pm)
Ok, for TGB in your game project it should be in <your game project>/common/gui/profiles.csIn Torque 2D you'll find the base profiles in modules/Sandbox/1/gui/guiProfiles.cs
The easiest way to find your primary profiles script (in Torsion) is to use ctrl-shift-f to search the project for (GuiDefaultProfile - don't forget the parenthesis at the beginning or you'll get a ton of hits.
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?