Game Development Community

GuiTextCtrl - Can it display multiple lines of text

by Roger Godfrey · in Torque Game Builder · 08/24/2006 (1:53 pm) · 4 replies

Hi All,

I am using GuiTextCtrl in my play area to show some information about a sprite. I also now want to show some additional information on multiple lines of text. This is proving to be problematic as GuiTextCtrl seems to ignore '\n' carrage returns.

Does GuiTextCtrl support multiple lines of text or will I have to instantiate a new GuiTextCtrl object for each line?

Or is there something all together much cleverer in T2D that I have not found yet? :)

Cheers,

Roger

#1
08/24/2006 (1:57 pm)
Not sure here about T2D but in TGE there is a guiMLTextCtrl, I think that the ML stands for Multi Line :)
#2
08/24/2006 (1:58 pm)
I haven't really used the GUI yet (except for the basic tutorial on TDN). However, I remember seeing GUIMlTextCtrl, which supports multilines. I've never tried using it, but I believe it's what your looking for.

edit: Dreamer beat me to it :)
#3
08/24/2006 (2:02 pm)
Use a GUIMLTextCtrl.

Add text with %ctrl.addText("Your text goes here.\nNew line here",true);


edit:
The ML stands for Markup Language. There is a limited set of Markup tags you can use to change the font, font color, etc.
#4
08/24/2006 (2:34 pm)
Thanks for the quick reply guys. Much appreciated.

I am going to have a crack at the GUIMLTextCtrl now (documentation on this seems a bit limited at the moment). If I have any success I will post my script code.

(Otherwise its lots and lots of instances of GuiTextCtrl to be thrown around the viewport!). :)

Rog

(edited to correct spelling)