Home   Help Search Login Register  

Author Topic: Word wrap text in custom interfaces  (Read 473 times)

0 Members and 1 Guest are viewing this topic.

Rocko Bonaparte

  • Guest
Word wrap text in custom interfaces
« on: 11 Jun 2005, 08:04:22 »
I'm working on a little interface for some multiplayer missions that allows the player to choose what they want to be when they respawn.  I'm trying to determine if there's a way to wrap static text.  That is, I want a long string to be broken up into the boundaries given to it.  Right now, the text gets truncated as soon as it reaches the right side of its boundary.  The only alternative I can see right now is creating multiple static text fields, each representing a line.  I'm hoping this is not what I have to do.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Word wrap text in custom interfaces
« Reply #1 on: 11 Jun 2005, 08:47:52 »
If you use titeText then the words do get truncated.  I found that using titleRsc wraps the words.  Check out General Barrons cutRsc/titleRsc Tutorial in thge Editor's Dept.
« Last Edit: 11 Jun 2005, 08:48:44 by THobson »

Rocko Bonaparte

  • Guest
Re:Word wrap text in custom interfaces
« Reply #2 on: 12 Jun 2005, 04:34:46 »
I don't think General Barron's tutorial applies as much to dialogs.  Then again, I'm obviously not that experienced.

I tried the GUI editor and found there's a multiline property.  I figured that was my salvation but it doesn't seem to work either.  This is what I am trying right now:

Code: [Select]
   class SQUAD_DESC : RscText
   {
      idc = 100;
      style = ST_LEFT + ST_MULTI;
      linespacing = 1;
      x = 0.1;
      y = 0.55;
      w = 0.5;
      h = 0.35;
      font = FontS;
      sizeEx = 0.020;
      text = "Riflemen are inexpensive and plentiful.  Use these troops for rapid, expendable reinforcements; or to maximise chances for the player to respawn in place.";
   };
I needed to specify a line spacing, so I assumed the number 1.  I've also tried 0.2 and 2 -- I don't really know units being used.  The text isn't wrapping.  It would help if I could find a mission where there was a multiline dialog.  The only thing I can think of trying now is the MFCTI description.ext and hope to find an example.

Rocko Bonaparte

  • Guest
Re:Word wrap text in custom interfaces
« Reply #3 on: 12 Jun 2005, 05:19:16 »
I think I figured it out.  I didn't have the ST_MULTI property defined up top, which kind of gets in the way, doesn't it? ;)