Mixing text and variables

BeyondtheTechBeyondtheTech Member Posts: 809
edited November -1 in Working with GS (Mac)
Is there a way to display text that would read: "You have 15 chances left!" using something like "You have " + (game.Chances) + " chances left."?

For the Display Text Action, it seems that you can put text, or just put a value, but not both?

Comments

  • firemaplegamesfiremaplegames Member Posts: 3,211
    Yes. Use the concatenate operator. It is two periods [..]

    So the above would look like this:

    "You have "..game.Chances.." chances left."

    You will need those quotes as well.

    Joe
  • BeyondtheTechBeyondtheTech Member Posts: 809
    Thanks, that's good to know. Is it in the Wiki? Didn't recall seeing it.
  • BeyondtheTechBeyondtheTech Member Posts: 809
    I can't enter spaces in the Expression Editor.
  • firemaplegamesfiremaplegames Member Posts: 3,211
    oh right...
    yeah, it's still a little bit wonky...

    you could make a global text attribute that would have the spaces in it...

    So:

    game.YouHave..game.Chances..game.ChancesLeft

    It starts to get ridiculous though...
    In reality, I would make all the text in Photoshop or another image editor...
  • BeyondtheTechBeyondtheTech Member Posts: 809
    Well, I would if there wasn't an issue with the alignment in the text. I do left-justification and line up the text but it still manages to bleed over the line.
  • firemaplegamesfiremaplegames Member Posts: 3,211
    I don't think the alignment works properly yet. Only centered currently (even though there are other choices...)
Sign In or Register to comment.