What is wrong with this text expression?

synthesissynthesis Member Posts: 1,693
edited November -1 in Working with GS (Mac)
DISPLAY TEXT >>
expression: "line of text 1"..\n.."line of text 2"

This is the result I desire:

line of text 1
line of text 2

Currently it results in "expression invalid".

Comments

  • victorkin11victorkin11 Member Posts: 251
    make sure you click the e for expression, not just type in the box!
  • victorkin11victorkin11 Member Posts: 251
    and you can included the "\n" in the text,
    "line of text 1\nline of text 2"
  • StusAppsStusApps Member, PRO Posts: 1,352
    victorkin11 said:
    and you can included the "\n" in the text,
    "line of text 1\nline of text 2"

    You're right, didn't know that. It works great.
  • synthesissynthesis Member Posts: 1,693
    Thank victor:
    I just figured it out too!!!
    the \n must be inside quotes.

    I tried that earlier...but I think I typed /n instead of \n

    So tricky :)

    BTW:
    \r also works but it might not if you integrate attribute calls.
    It looks like some other C escape sequences work too.

    such as \t for a tab space.
  • victorkin11victorkin11 Member Posts: 251
    And you can make 3 attribute text, first name, second name, full name.

    then use change attribute full name = first name .. second name.
    it work!
  • synthesissynthesis Member Posts: 1,693
    I just wrote a tip on GSProForum. It might be worth your time.

    This tip explains how you can create text based instructions in an actor that is template based and allows for some formatting. An example use would be smart text for each level as a splash screen - then tap the actor to start the level.

    Here is the tip:
    http://www.gsproforum.com/viewtopic.php?f=21&t=111

    Example:
    image
  • victorkin11victorkin11 Member Posts: 251
    Thank for you tips!

    My test told me, text won't follow the actor size, but follow the actor rotation, no blending mode change, not affected by actor alpha, and when the font size over 100, it will have error! but not sure the max size.
  • IsabelleKIsabelleK Member, Sous Chef Posts: 2,807
    I checked this topic on GSProForum, and I have one question: I have many lines of dialogues in my game and sometimes they are separated in few lines. Now I have an actor for every line of dialogue.
    Is it possible to use your tip to create few lines of defined text with one actor, and iPhone will display it as few lines?
    I'm asking because making a different actor for every line of text is very tiring, and iPhone doesn't recognize CTRL+Enter command in Display Text behavior.

    Thank you.
Sign In or Register to comment.