How do I can add 1 every second to a text object

Get help using Construct 2

Post » Wed Oct 14, 2015 8:48 am

Hello I would like now how i can add 1 every second and every click in a button to a text ?

For exemple: I wait 1 second add 1 to the text
I click the button add 1 to the text

Please help,
Thanks!
B
3
Posts: 5
Reputation: 185

Post » Wed Oct 14, 2015 9:05 am

I would highly suggest your read the manual and do some examples (open c2, new, and look down that list.) pick one and actually try to redo it, thereby learning.

To answer your question:

Add Event
Click system
Scroll down and find every x seconds (choose your desired seconds in your case it is "1")
Now create a global variable called counter
Now add an action
Same thing hit system, now find Add Too
select counter variable and make it 1

So every second will add 1 to global variable "counter"
To dispaly in text file.
Add action
Go to text file and set to variable "counter"


And the button. Create a sprite, call it button. Add touch to project

Add event. Touch ... on object "button"
Add action. Add too... you get the drift ;)
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,708

Post » Wed Oct 14, 2015 11:16 am

I am lock at this part :
To dispaly in text file.
Add action
Go to text file and set to variable "counter"

Can you help me please ? :/
B
3
Posts: 5
Reputation: 185

Post » Wed Oct 14, 2015 11:31 am

Add action:
select the text file
scroll down till you see set text
you get a text input bar...
Text [ start typing counter and a drop down list will show, select the variable counter. ]
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,708

Post » Wed Oct 14, 2015 4:36 pm

Ok thanks you :)
And sorry i am new with the software
and I am french and the tutorials are in english
B
3
Posts: 5
Reputation: 185

Post » Wed Oct 14, 2015 6:04 pm

@Quenntinne,

No problem. I would recommend you do the examples I told you about. Open C2, hit file. new and work your way through them. You will learn tons and tons ;)
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,708

Post » Thu Oct 15, 2015 2:53 pm

I have an other question for you:
Do you know how to change the collor of a text in a button ?
And thanks for your advises :)
B
3
Posts: 5
Reputation: 185

Post » Thu Oct 15, 2015 3:01 pm

Image
B
65
S
23
G
7
Posts: 1,505
Reputation: 10,896

Post » Thu Oct 15, 2015 4:29 pm

Thanks you :D
B
3
Posts: 5
Reputation: 185

Post » Thu Oct 15, 2015 4:42 pm

Just noticed this, but here is an example of 2 timers I had in my dropbox.
One is counting down, one is counting up. They both format to minutes and seconds.

https://dl.dropboxusercontent.com/u/85412219/forumposts/Timers.capx
B
230
S
62
G
33
Posts: 902
Reputation: 40,323


Return to How do I....?

Who is online

Users browsing this forum: David181, evillair and 57 guests