Text Wrap Won't Work When String Changed

StuartYStuartY Member Posts: 134
edited November -1 in Working with GS (Mac)
Hi guys,

I've got an actor set up to display a string attribute with a centre-aligned wrap. When I enter the string by manually altering the attribute from the editor it works fine, e.g;

This is an
example of
a sentence.

When I alter the string, however, using change attribute and an expression, e.g. "This is an example of a sentence" it displays like this;

This is an ex
ample of a s
entence.

Now, I've heard of line breaks and spaces but I did't realise we had to enter WORD breaks in GS! Any ideas where I'm going wrong, or is this just a bug? Any workaround ideas, as you can't place line breaks directly in a string either.

Note; examples are right-aligned because of the forum.

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi StuartY, that's odd. the only thing I can think of is put the initial text straight into a text attribute. I've just done a test, and it works fine.

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

  • StuartYStuartY Member Posts: 134
    What did you do, specifically? Maybe I'm doing something wrong. So my string is called "text". My actor is set up to display game.text. The string is blank, but I put in a rule to change attribute game.text to this expression: "Example text". Does that sound like what you were doing?
  • StuartYStuartY Member Posts: 134
    Cheers Gyro, just cracked it. You have to just enter the text in the box without hitting the e to use the expression editor, and remove the expression if it pops up. Must be something to do with how strings behave.
  • micksolomicksolo Member Posts: 264
    so that's fine if you're only displaying text, but if you want to display text + the value of an attribute?
Sign In or Register to comment.