How to add a text display line break?

Hi all,

I'm trying to split up display text using line breaks, but not having much success.

I've attempted the following formatting:

attribute_1.."\r"..attribute_2 output = attribute_1\rattribute_2
attribute_1.."\n"..attribute_2 output = attribute_1\nattribute_2

attribute_1.."/r"..attribute_2 output = attribute_1/rattribute_2
attribute_1.."/n"..attribute_2 output = attribute_1/nattribute_2

"blahblah".."\r".."blahblah" output = blahblah\rblahblah
"blahblah".."\rblahblah" output = blahblah\rblahblah

attribute_1..\r..attribute_2 output = 0
attribute_1..\n..attribute_2 output = 0

Any ideas what I'm doing wrong? I thought .."\r".. and .."\n".. are meant to work? I'm using the windows GS, if that makes a difference.

Thanks in advance!

Answers

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598

    Hi @Mekonbekon I use the Mac version but as far as I'm aware, the Windows version is the same in this instance.

    So to your problem: in every example, you've added an equals sign without quotes.... so for the first one put in the expression editor for a Display Text Behaviour (the rest similar) should be:

    attribute_1.."\r"..attribute_2 output.."="..attribute_1\rattribute_2

    Hope I've understood what you're after correctly...

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • MekonbekonMekonbekon Member Posts: 8
    Hi @gyroscope, sorry, my formatting could have been better...

    The text after "output =" is what is actually displayed on screen, so I enter:

    (attribute_1).."\r"..(attribute_2)

    into the display text field and:

    attribute_1\rattribute_2

    is displayed in game, rather than:

    attribute_1
    attribute_2

    It appears that the "\r" or "\n" isn't being recognized as a line break indicator. Hope that makes a little more sense :)
  • sparkaniasparkania Member, PRO Posts: 300
    I am having the same issue.. I read another thread recommending the "\n" and I get displayed too instead of as a function (Windows)
  • PixelMetalPixelMetal Member Posts: 283
    I am having the same issue.. I read another thread recommending the "\n" and I get displayed too instead of as a function (Windows)
    Same here, lines breaks not working on the Windows side.

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited January 2013

    @Mekonbekon D'oh, I see what you mean now (I was a bit slow there...) :-)

    Sorry to hear via @sparkania and @PixelMetal that line breaks aren't working on the Windows version...

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • MekonbekonMekonbekon Member Posts: 8
    Ok, thanks for looking into this, @gyroscope & cheers @sparkania and @PixelMetal for corroborating - let's hope they get this fixed for the next update!
  • JGary321JGary321 Member Posts: 1,246
    In windows it would look like this....

    Display Text:
    "Hello, how are you?".. (press enter)
    "I am well."..(press enter)
    "Awesome!"

    Note: This makes it works in GS Windows, but I have not tested it on the device itself yet. If you test on device reply here to inform if it works on device.

    Also note, do not use line breaks for display texts on projects that you are transferring from windows to mac or mac to windows. It won't work correctly.

    IF you must do it, then use one system for all text behaviors. So, do all Display Text on the windows machine and other code on mac machine etc...
  • PixelMetalPixelMetal Member Posts: 283
    edited January 2013
    In windows it would look like this....

    Display Text:
    "Hello, how are you?".. (press enter)
    "I am well."..(press enter)
    "Awesome!"

    Note: This makes it works in GS Windows, but I have not tested it on the device itself yet. If you test on device reply here to inform if it works on device.

    Also note, do not use line breaks for display texts on projects that you are transferring from windows to mac or mac to windows. It won't work correctly.

    IF you must do it, then use one system for all text behaviors. So, do all Display Text on the windows machine and other code on mac machine etc...
    This doesn't work for dynamically created text content where the position of the line break may change.

  • MekonbekonMekonbekon Member Posts: 8
    @JGary321 - hmm, that didn't work for me. I'm assuming that by (press enter) you mean press the enter button, not add that text in brackets?
  • JGary321JGary321 Member Posts: 1,246
    edited January 2013
    Correct. Make sure you have the expression editor open. Also make sure the text is in the quotes and you are using the .. Works for me. I tried it right before posting.

    "Hello, how are you?"..

    that's exactly how it should look.
  • sparkaniasparkania Member, PRO Posts: 300
    edited January 2013
    no dice.. Tried the enter key, \n, \r, \br, br/, and even &#xD .... nothin
Sign In or Register to comment.