How do I make text equal a variable

Get help using Construct 2

Post » Thu Sep 15, 2016 6:46 am

So I added this topic on here earlier. I thought I figured it out ,but uh... Here we are! Anyways what I mean is like. Let's say a variable originally equals 13. Then if a random event happens... A key is pressed or, the player touches it. Then the text would change to 12, or 14. Or even 5. Just make the variable change the text to equal variable.
B
8
S
1
Posts: 11
Reputation: 424

Post » Thu Sep 15, 2016 7:04 am

If you just want to set a text to a variable it is as simple as this. You can use a trigger to change it or just do it every tick if you want.

Image

Code: Select all
So on "M" pressed --> add 10 to Score --> Set text to Score


That would add 10 to the Score variable and then set the text to the new value.
B
52
S
22
G
12
Posts: 728
Reputation: 11,722

Post » Thu Sep 15, 2016 8:24 am

In case you mean that you are stuck on the format it takes, it's "text"&variable, the &symbol allows you to display the variable in the text box.
B
45
S
15
G
73
Posts: 2,021
Reputation: 43,424

Post » Tue Sep 20, 2016 8:15 pm

I could of sworn I replied. Anyway thanks!
B
8
S
1
Posts: 11
Reputation: 424


Return to How do I....?

Who is online

Users browsing this forum: alextro, stevenode, tarek2 and 9 guests