GuiTextEditCtrl masks?
by Brandon Beauchene · in Game Design and Creative Issues · 03/04/2005 (7:02 pm) · 15 replies
Simple question, is it possible to create a text edit box with a kind of bmp mask so that its not always just a bland white box? Instead a neat little bmp image with a "clear" text edit box.....ooo the possibilities :)
#2
all you have to do (for you curious peeps) is something like this
new GuiControlProfile (CharacterCreationEditProfile)
{
opaque = false;
fillColor = "255 255 255";
fillColorHL = "128 128 128";
border = true;
borderThickness = 1;
borderColor = "255 128 128";
fontType = "Arial";
fontSize = 15;
fontColor = "40 231 240";
fontColorHL = "40 231 240";
fontColorNA = "128 128 128";
textOffset = "0 2";
autoSizeWidth = false;
autoSizeHeight = true;
tab = true;
canKeyFocus = true;
};
the borderThickness = 1; can be changed to your likeing, along with the color, if you use border = 0; then no border is applied.
then just set the profile of the edit box as whatever you named this one (CharacterCreationEditProfile in this case).
hope that helps anyone that had the same curiosity as me :)
03/04/2005 (7:29 pm)
I got it :)all you have to do (for you curious peeps) is something like this
new GuiControlProfile (CharacterCreationEditProfile)
{
opaque = false;
fillColor = "255 255 255";
fillColorHL = "128 128 128";
border = true;
borderThickness = 1;
borderColor = "255 128 128";
fontType = "Arial";
fontSize = 15;
fontColor = "40 231 240";
fontColorHL = "40 231 240";
fontColorNA = "128 128 128";
textOffset = "0 2";
autoSizeWidth = false;
autoSizeHeight = true;
tab = true;
canKeyFocus = true;
};
the borderThickness = 1; can be changed to your likeing, along with the color, if you use border = 0; then no border is applied.
then just set the profile of the edit box as whatever you named this one (CharacterCreationEditProfile in this case).
hope that helps anyone that had the same curiosity as me :)
#3
03/04/2005 (7:29 pm)
You can modify the GuiTextEditProfile, changing the "fillColor" to any valid RGB value or...you can create another profile based on that one, setting "fillColor" to suit your needs and setting your control's "profile" to it :) I know that this doesn't give you any transparency but it does give you more possibilities. FYI - the GuiMLTextCtrl has a setAlpha(0-255) method which can make the text transparent but that control is not editable like the GuiTextEditCtrl.
#4
03/04/2005 (7:30 pm)
Must have been typing at the same time :)
#5
how does it work? and how would you fill it with text from a variable/variables/files? Do I use it in conjunction with a GuiScrollCtrl?
just thought id ask since your the only person that has mentioned the ML controls
03/04/2005 (11:06 pm)
Hey jacob what do you know about the GuiMLTextEditCtrl?how does it work? and how would you fill it with text from a variable/variables/files? Do I use it in conjunction with a GuiScrollCtrl?
just thought id ask since your the only person that has mentioned the ML controls
#6
03/04/2005 (11:39 pm)
There is a GuiMLTextEditCtrl also
#7
03/05/2005 (12:06 am)
Sigh...i know...but theres no documentation on how to use them or what they do etc. thats what i was asking
#8
03/05/2005 (7:10 am)
@Brandon: the GuiMLText(Edit)Ctrl is for Multi Line text and you can fill it with text from a file or from a variable. Take a look at Help.cs and one of the .hfl files to see how to fill it from a file. I use it a bit differently than the stock help in TGE: since I need it to display descriptions of inventory items that I don't want people to just be able to see and/or alter by opening up a text file from the directory, I have that text stored in a .cs file in variables. This way when the .cs is compiled, it becomes "less" readable to the average user and my information is safer :) So, to fill your GuiMLText(Edit)Ctrl from a variable, you can do this: YourControlName.setText(YourVariable). And yes, you can use it in conjunction with a GuiScrollCtrl by placing the text control inside of it.
#9
03/17/2005 (2:06 pm)
Ahhhhhhh. But what about saving the contents? does it save the contents as a single variable? If so how would you break that variable down into writable lines? for instance. You have your multiline text box filled with a bunch of stuff, but you need to keep the each line separated. would you have to "parse" the variable, pulling out each line? or could you simple "grab" the next line in the box that hasnt been read yet?
#10
03/17/2005 (4:57 pm)
Not sure how to pull separate lines from a GuiMLText(Edit)Ctrl because it does store the text in a variable but you may be able to achieve your goal by using a GuiTextListCtrl. In this Control, each row has a unique id, which you can use to pull text from. There is an example of this in the Help.cs file - user clicks on a line in the GuiTextListControl and the corresponding help file is shown. Do a dumpConsoleClasses(); from the console and all the registered public methods will be dumped to the console. (You can save the console.log file when you exit the game for later use) Then look for GuiTextListCtrl or any other class for that matter to see what methods it has for you to play with :)
#11
05/05/2006 (12:42 pm)
Thanks!!
#12
05/07/2006 (8:53 pm)
Hi, I am a student working on a school project using torque gui editor. Its my first time using such a program, can anyone pls enlighten me on how to change the colour of the text in GuiTextEditCtrl ?
#13
you have to create a new guiControlProfile or edit one
be something like
--------------------------------
new GuiControlProfile(MyNewTextProfile)
{
font = "Ariel"; // name of font you wish to use
fontColor = "0 0 0"; // rbg values here where 0 0 0 is black and 255 255 255 is white
fontColorHL = "125 125 125"; // this i believe is the color of font when your highlighting it
fontSize = 15; // size of font you wish to use
}; // cant remember if you need the ; at the end of this block or not
there are other attributes you can set, check out client/scripts/defaultprofiles.cs and customprofiles.cs in the starter.fps demo to see some of the attributes and profiles prebuilt
once you have your profile setup you need to set the profile of the GuiTextEditCtrl to match this one. in the example it would be
profile = "MyNewTextProfile";
hope that helps :)
06/07/2006 (9:30 am)
@ linyou have to create a new guiControlProfile or edit one
be something like
--------------------------------
new GuiControlProfile(MyNewTextProfile)
{
font = "Ariel"; // name of font you wish to use
fontColor = "0 0 0"; // rbg values here where 0 0 0 is black and 255 255 255 is white
fontColorHL = "125 125 125"; // this i believe is the color of font when your highlighting it
fontSize = 15; // size of font you wish to use
}; // cant remember if you need the ; at the end of this block or not
there are other attributes you can set, check out client/scripts/defaultprofiles.cs and customprofiles.cs in the starter.fps demo to see some of the attributes and profiles prebuilt
once you have your profile setup you need to set the profile of the GuiTextEditCtrl to match this one. in the example it would be
profile = "MyNewTextProfile";
hope that helps :)
#14
I found the method (after 4 hours of digging) to get the text out of GuiMLTextEditCtrl:
YourMethodName.getText();
I know, it's simple. Why aren't these methods post on TDN?
03/29/2008 (10:50 pm)
I'm posting this for others like me who are very frustrated with the lack of documentation on the controls!I found the method (after 4 hours of digging) to get the text out of GuiMLTextEditCtrl:
YourMethodName.getText();
I know, it's simple. Why aren't these methods post on TDN?
#15
As to why they're not on TDN, it's mostly a community effort. So it seems as though most of these items haven't been filled in. Feel free to add your findings to TDN.
03/30/2008 (2:47 am)
GuiMLTextEditCtrl.dump() in the console would reveal all the nifty things you can do with it. All objects can be dumped to get a list of all the methods/functions available to them.As to why they're not on TDN, it's mostly a community effort. So it seems as though most of these items haven't been filled in. Feel free to add your findings to TDN.
Torque 3D Owner Frogger