attribute + text in function 'display text'?

jsorr2jsorr2 Member Posts: 279
edited November 2014 in Working with GS (Mac)

I was wondering how to display an interger value as well as text inside the Display Text function?
E.g.
Display Text: I have 'game.X' apples.

X = 9

I have '9' apples.

Best Answer

  • jamie_cjamie_c ImagineLabs.rocks Posts: 5,772
    edited November 2014 Accepted Answer

    Use the expression editor and make the text field look like this:

    "I\32have\32"..game.X.."\32apples."

    The \32's show up as spaces and the .. before and after game.X concatenate the text together with the attribute value.

Answers

  • jsorr2jsorr2 Member Posts: 279

    Works like a charm, thanks Jamie

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    Sweet! :)

  • SocksSocks London, UK.Member Posts: 12,822
    edited November 2014

    @jsorr2 said:

    @jamie_c said:
    The \32's show up as spaces . . .

    Do you know you can also just hit option+space to get a space, this has the obvious advantage of not\32making\32your\32text\32unreadable\32in\32the\32expression\32window ! :)

  • jsorr2jsorr2 Member Posts: 279
    edited November 2014

    @Socks said:
    Do you know you can also just hit option+space to get a space, this has the obvious advantage of not\32making\32your\32text\32unreadable\32in\32the\32expression\32window ! :)

    No Idea what the option button is as I use a windows keyboard.

  • SocksSocks London, UK.Member Posts: 12,822
    edited November 2014

    @jsorr2 said:
    No Idea what the option button is as I use a windows keyboard.

    Oh well ! Personally I'd try all the obvious modifier keys, but if that's too much of a stretch then at least you know \32 works.

  • jsorr2jsorr2 Member Posts: 279

    It was alt+space. That helps heaps, cheers @socks :smile:

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    edited November 2014

    @Socks, yeah I was aware of that, but to avoid the 'cross platform' issue I stuck with the \32. :)

    It's certainly worth pointing out though, thanks.

Sign In or Register to comment.