How do I Input a number and then calculate

Get help using Construct 2

Post » Thu Mar 05, 2015 12:55 am

Hi,
I make power kites, I am want to make a small program to help me design NASA para wing kites.
What I need to know is how to input a numbers witch will be the height of the kite. From that number I can calculate all the stuff I need to know. I will use the input number in about 40 calculations. I got a textbox that I can
input the numbers. I have a var that is set to 0. How do I set this var to the number that is in the textbox?
Let say the input number is 30 I want the var to go from 0 to 30. Then I want to use that var(30) calculate many
things. So have calculation #1,calculation #2,calculation #3 and so on. how do I do that?
I know that is a lot.
thank you
renny :roll:
EDIT:
Sorry, one more thing, I need all the product of the calculations to print out on the screen. Each one will have it's
own X,Y position.
thanks
B
7
S
1
Posts: 53
Reputation: 535

Post » Thu Mar 05, 2015 2:07 am

you can make a Slider and make the range go from 0-30

then use that in your calculation: SliderBar.Value * whatever you want.

or use a TextBox like: int(TextBox.Text) + 5 or whatever your calculation is.
B
100
S
33
G
16
Posts: 1,204
Reputation: 16,865

Post » Thu Mar 05, 2015 4:32 am

Perhaps you are looking for the System.SetValue Action? By assigning the value of a slider or textbox to a variable, you can use it even after the textbox/slider is gone. I hope this is what you wanted.
B
14
S
5
G
1
Posts: 189
Reputation: 1,536

Post » Thu Mar 05, 2015 4:16 pm

you could do it like this
You do not have the required permissions to view the files attached to this post.
B
257
S
43
G
15
Posts: 1,992
Reputation: 41,535

Post » Thu Mar 05, 2015 10:14 pm

Great, that give me alot to think about. A slider may be the way to go. I did not think of that.
Lordshiva1948 that was a very good example I will let you all know what i did.
Thank you all
renny
B
7
S
1
Posts: 53
Reputation: 535

Post » Thu Mar 05, 2015 11:27 pm

One thing I need to change, I don't under stand the text box stuff yet. As I slide the bar I need the numbers to be displayed as the bar is being used. That way I can stop at the number I want. How would you make the numbers show on the screen as you are sliding the bar?
Thank You Renny. :mrgreen:
B
7
S
1
Posts: 53
Reputation: 535

Post » Thu Mar 05, 2015 11:43 pm

sadsack wrote:How would you make the numbers show on the screen as you are sliding the bar?

Event
Slider Bar...Compare value...not equal to..int(Text.Text)
Action
Text...set text to..Slider.Bar.Value
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Fri Mar 06, 2015 12:17 am

Here is what I got when I try your code.

I must be putting in the wrong way see photo
what am I doing wrong?
thank you
renny
You do not have the required permissions to view the files attached to this post.
B
7
S
1
Posts: 53
Reputation: 535

Post » Fri Mar 06, 2015 12:29 am

Text is default name for text object..if you rename text object from Text to Something.....
Action is
int(Something.Text)
You do not have the required permissions to view the files attached to this post.
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Fri Mar 06, 2015 1:02 am

Ok, I am going line by line and learning this so I don't have to get help on this again.
will get back to you.
renny
B
7
S
1
Posts: 53
Reputation: 535

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 29 guests