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
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:
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.
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
I am lock at this part :
[quote:14vumnja]To dispaly in text file.
Can you help me please ? :/
Develop games in your browser. Powerful, performant & highly capable.
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. ]
Ok thanks you
And sorry i am new with the software
and I am french and the tutorials are in english
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
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
CSS Button Generator
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.