Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Multi-Line GUI Box

Discussion in 'Immediate Mode GUI (IMGUI)' started by Predster, Apr 16, 2008.

  1. Predster

    Predster

    Joined:
    Sep 11, 2007
    Posts:
    145
    Greetings,

    I'm having a little bit of a problem creating a GUI box with multi line text. I've tried what was suggested in this thread: http://forum.unity3d.com/viewtopic.php?t=7826&highlight=gui+multi+line+text

    But good old "/n" does not create a new line for me. Also, using Alt+return gives me the following error "error BCE0044: expecting '"', found '\n'." instead of giving a new line.


    This is my code:
    Code (csharp):
    1.  GUI.Box(Rect(0,Screen.height - 60,Screen.width,60), triggerText);
    where triggerText is a string.
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Newline is "\n". Alt+return makes a newline when entering text in the Inspector; you wouldn't want to do that in scripts.

    --Eric
     
  3. Predster

    Predster

    Joined:
    Sep 11, 2007
    Posts:
    145
    Thanks (I'm obv a n00b!) :oops: :oops: :oops: :oops: