Author Topic: HUD Text - Multiline?  (Read 3345 times)


  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 30
    • View Profile
HUD Text - Multiline?
« on: January 27, 2015, 01:01:44 AM »

Im trying to use the HUDText script as a "log shower", so basically multiple scripts ask for a log, it is shown in the screen at the hud text position, and HUDText neatly moves them up if needed to. However, I altered a bit of the script to change the default label created by it, including changing it from ResizeFreely to ResizeHeight, but, as you can imagine, when a log with 2+ lines show up, they just get one over the other.

Is there some easy way to fix this, maybe change the offset calculation a little bit?

Anyway, thanks!


  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: HUD Text - Multiline?
« Reply #1 on: January 28, 2015, 02:45:43 AM »
Instead of simply calling hudtext.Add(text), split it up into multiple lines first.
  1. string[] lines = text.Split('\n');
  2. foreach (string s in lines) hudtext.Add(s, ...);
P.S. Although you may need to add them in reverse order instead.