Game Development Community

New gui elements

by Mario N. Bonassin · in Torque Game Engine · 10/18/2005 (1:37 pm) · 4 replies

I want to create a GuiTextEditControl with a different font size than the standard. But I don't want to loose the standard. I figured out to make the change I want is to put it in CustomProfiles.cs but this replaces the standard. How do I create a GuiTextEditLGControl so that it can be selected under the NewControl list with the original GuiTextEditControl being unchanged? The only difference would be that the standard would have fontSize = 14 and my new one will have fontSize = 36.

#1
10/18/2005 (1:44 pm)
Make a new profile that is the same as the GuiTextEditControl but has the larger font size and then select that as the profile for your control in the guiEditor.
#2
10/18/2005 (2:05 pm)
I added this to the CustomProfiles.cs

new GuiControlProfile (GuiTextEditProfile)
{
opaque = true;
fillColor = "255 255 255";
fillColorHL = "128 128 128";
border = 3;
borderThickness = 2;
borderColor = "0 0 0";
fontSize = 36;
fontColor = "0 0 0";
fontColorHL = "255 255 255";
fontColorNA = "128 128 128";
textOffset = "0 2";
autoSizeWidth = false;
autoSizeHeight = true;
tab = true;
canKeyFocus = true;
};

This did what I wanted but every instance of GuiTextEditControl now has the larger font size. which isn't what I wanted. I only wnat the larger size for a few of these instances. I tried to do this

new GuiControlProfile (GuiTextEditLGProfile) //added LG to the name
{
opaque = true;
fillColor = "255 255 255";
fillColorHL = "128 128 128";
border = 3;
borderThickness = 2;
borderColor = "0 0 0";
fontSize = 36;
fontColor = "0 0 0";
fontColorHL = "255 255 255";
fontColorNA = "128 128 128";
textOffset = "0 2";
autoSizeWidth = false;
autoSizeHeight = true;
tab = true;
canKeyFocus = true;
};

but it didn't do anything.

Do I need to do something some where other than the CustomProfiles.cs to get what I want?
#3
10/18/2005 (2:40 pm)
Open up the Gui editor for the control you want to change, hit the dropdown list for "profile", and scroll down until you see GuiTextEditLGProfile, select, and apply.

When you modified CustomProfiles.cs, all you did was create the profile. You need to apply the new profile in the Gui Editor.
#4
10/18/2005 (2:52 pm)
Ahhh thanks. took a bit but I figured out what you were talking about. I kept looking for it in the New Control dropdown.