Increment the text box number?

Not favoritedFavorited Favorited 0 favourites
  • 3 posts
From the Asset Store
Step into the legendary boxing ring in Boxing Legends! Master your reflexes, aim for the highest score.
  • In Construct 3, I have a text box containing a number, which is 40, and it's associated with a panel.

    Every time the player clicks the panel, the value in the text box should increase by 50%.

    How do I do this?

    EX:

    If the text box contains 40, and I click the panel, the value should increase by 50%, which makes it 60.

    If it's 60, it should increase to 90.

    For 90, it should increase to 135.

  • It's better to use a variable - increase the variable and set the text to that variable.

    Without a variable you'll need to convert the text to number and back.

    Textbox set text to str(int(self.text)*1.5)

    or use float() expression instead of int() if you need decimals.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's better to use a variable - increase the variable and set the text to that variable.

    Without a variable you'll need to convert the text to number and back.

    Textbox set text to str(int(self.text)*1.5)

    or use float() expression instead of int() if you need decimals.

    Thank you

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