Game Development Community

how do you do multi line text in the Gui

by Nmuta Jones · in Torque Game Engine · 02/26/2010 (7:44 am) · 5 replies

I have some items that need a multi line display. All I need it 3 lines.

How do you do this?
I tried doing \n but I don't seem to be applying it correctly.
I have shapes that will display 3 variables above them (changes every time the mission loads based on random numbers)

I have a GuiShapeNameHud in my playGui.gui file, so I'm getting the shape name above the item, I just need to get 3 short strings in the display.

thanks

#1
02/26/2010 (8:00 am)
Tried using GuiMLTextCtrl?
#2
02/26/2010 (8:07 am)
Yeah, I had already done a search and found this:

tdn.garagegames.com/wiki/GUI/Profiles/ControlList#GuiMLTextCtrl


but the list is incomplete, does not appear to give the line break command, and I'm not even sure how to use it even if I had the correct command.
#3
02/26/2010 (8:45 am)
I should clarify that I need multi line in the player gui.

I looked at the GuiMLTextCtrl stuff I referenced above, and the examples they give are .hfl files..... which look more like game menus, not gui text in the game.



#4
02/26/2010 (9:52 am)
There's a whole markup set that goes with them for links, colors, fonts, etc. The text in it wraps, so if you go past the horizontal bounds, it should display on the next line. Here's a tooltip gui I created using two of them so that I could get multiline text for item names and descriptions:

new GuiControl(ToolTipGui) {
   profile = $modelessGuiProfile;
   horizSizing = "right";
   vertSizing = "top";
   position = "0 0";
   extent = "1024 768";
   minExtent = "1024 768";
   visible = "1";
   
   new GuiBitmapCtrl(ToolTipFrame) {
      Profile = $defaultGUIProfile;
      HorizSizing = "right";
      VertSizing = "top";
      Position = "0 0";
      Extent = "200 60";
      MinExtent = "200 60";
      canSave = "1";
      Visible = "1";
      hovertime = "1000";
      bitmap = $backingCraft;
      wrap = "0";
      
      new GuiBitmapCtrl(ToolTipIcon) {
         Profile = $defaultGUIProfile;
         HorizSizing = "right";
         VertSizing = "top";
         Position = "0 0";
         Extent = "39 39";
         MinExtent = "39 39";
         canSave = "1";
         Visible = "1";
         hovertime = "1000";
         bitmap = $artPath @ $blankGreen;
         wrap = "0";
      };
      
      new GuiMLTextCtrl(ToolTipName) {
         canSaveDynamicFields = "0";
         Enabled = "1";
         isContainer = "0";
         Profile = $lightTextProfile;
         HorizSizing = "right";
         VertSizing = "bottom";
         position = "45 2";
         Extent = "75 18";
         MinExtent = "75 18";
         canSave = "1";
         Visible = "1";
         hovertime = "1000";
         Margin = "0 0 0 0";
         Padding = "0 0 0 0";
         AnchorTop = "1";
         AnchorBottom = "0";
         AnchorLeft = "1";
         AnchorRight = "0";
         text = "Name:  Qty: ";
      };
      
      new GuiMLTextCtrl(ToolTipDesc) {
         canSaveDynamicFields = "0";
         Enabled = "1";
         isContainer = "0";
         Profile = $lightTextProfile;
         HorizSizing = "right";
         VertSizing = "bottom";
         position = "45 50";
         Extent = "96 18";
         MinExtent = "96 18";
         canSave = "1";
         Visible = "1";
         hovertime = "1000";
         Margin = "0 0 0 0";
         Padding = "0 0 0 0";
         AnchorTop = "1";
         AnchorBottom = "0";
         AnchorLeft = "1";
         AnchorRight = "0";
         text = "Desc:";
      };
      
   };
};

I'm kind of hoping to get them working with a list control for multiline chat and such at some point...
#5
02/26/2010 (9:56 am)
wow thanks