Moving Digits & Text

This forum is currently in read-only mode.
From the Asset Store
Change delay, create new lines, "backspace" the text
  • In my GUI, the word "Score" and the digits for it to the right:

    + System: Always (every tick)

    -> Health: Set text to "Health: " & Hero ('Health')

    -> Score: Set text to "Score: " & Score ('score')

    -> System: Set global variable 'Score' to Score ('score')

    What I have tried doing is making the digits to the left of the word "score." I have tried adding spaces, using quotes, mixing and matching. I either get errors or I get to the closest possible where the digits is to the left but no spaces: 0Score

    How do I get the spaces in correctly?

    Thank you.

  • Here's what I'd do:

    Always Set Score X = DisplayWidth - Digits.Width - Score.Width

    or

    Always Set Score X = Digits.X - Score.Width

    You'll have to do some tweaking to make it look nice of course, and not clumped up or cut off. I don't know if the origin on Text objects is on the far left of the textbox or if it's centered. If it's centered, use the first one. If not, the second one should work fine.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Forgive me. I am still learning the way this program works.

    This is what I have:

    + System: Always (every tick)

    -> Score: Set text to "Score: " & Score ('score')

    -> System: Set global variable 'Score' to Score ('score')

    And I have tried but I keep getting errors. I am not putting bits in the right places it seems. I am not sure how the Xs work out in this, or if they are variables. Could you clarify it just a bit more for me please?

    Thank you.

  • +System: Always (every tick)

    ->Score: Set text to score('score') & " Score"

    works for me.

    Or use two text objects.

    Not sure if that's what you were trying to do though.

  • I got it now. That works and I understand it more now. Thank you.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)