Update textbox with variable contents on change?

Get help using Construct 2

Post » Tue Jan 31, 2017 8:44 pm

Is there a way to update a text box with the contents of a variable when the variable changes? Not just on a specific click, but in every way the variable can change?
B
4
S
1
Posts: 5
Reputation: 312

Post » Tue Jan 31, 2017 8:54 pm

Set text to variable every tick always shows the current value of the variable, is that what you want? Or do you mean update it ONLY when it changes?
B
47
S
17
G
81
Posts: 2,221
Reputation: 48,089

Post » Tue Jan 31, 2017 9:11 pm

That can probably work thanks.

But would be nice to know that way too.
B
4
S
1
Posts: 5
Reputation: 312

Post » Tue Jan 31, 2017 9:17 pm

If for some reason you want to set up something where you show only when the variable changes you could use a comparison variable.
Var1 = 20. (changes)
Var2 = 20.
If Var1 is not equal to Var2, set text to Var1.
Set Var2 = Var1.
B
47
S
17
G
81
Posts: 2,221
Reputation: 48,089

Post » Tue Jan 31, 2017 9:35 pm

Or create a function to change specifically this one variable (like a mutator).

>> On Function "SetVar1"
---->>Set Var1 = Function.Param(0)
---->>Set Textbox text to Var1
B
74
S
31
G
26
Posts: 994
Reputation: 20,198


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 7 guests