textbox and mathematics

Discussion and feedback on Construct 2

Post » Wed Dec 11, 2013 8:48 pm

Hello,

I wanted to know the way to use textbox and mathematical operations.


For example:

Input value (in textbox)?

==> SetText (textbox value + 2)


It's pretty simple, but I can not find how to transcribe this with construct 2 code.

Thank you for your help.
B
4
S
1
Posts: 7
Reputation: 546

Post » Wed Dec 11, 2013 8:54 pm

Set textbox text to str(float(textbox.text)+2)
if you work with whole numbers numbers, int works as well ofcmindfaQ2013-12-11 20:55:49
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Wed Dec 11, 2013 9:52 pm

Hello mindfaQ,

I tried, but it does not work, or I do not put the correct syntax.
Would you an example .Capx ?

Thank you.
B
4
S
1
Posts: 7
Reputation: 546

Post » Fri Dec 13, 2013 7:25 pm

Hello,

Well, I think I found the solution :

http://graphicwindows.fr/forum/SCROLLING%20FRONTAL.capx


But I'm facing a small problem again ...

I would make sure that the value entered in text box can be detected and what is more, to say that if it is different or equal to a threshold, then the value is 0.

You see what I mean?

If anyone can help me on the file, making such corrections.

Thank you.

B
4
S
1
Posts: 7
Reputation: 546


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 5 guests