I made a little counter for time remaining to level ends in my game. I can't upload it now, but the example consists only in:
1. Add a Text on layout;
2. Add a global variable like "secondsToPlay" and set a number of seconds, for example 150 for 2 minutes and a half, or 120 to 2 minutes on Event Sheet;
3. Add Event: System > Every 1 second(s);
- 3.1. Add Action > Text > "Time Remaining: " & Floor(secondsToPlay/60) & ":" & Floor(secondsToPlay%60)
- 3.2. Add Action > System > Subtract 1 from secondsToPlay;
The counter will start: 2:0 - 1:59 - 1:58 - ... - 1:9 - n
The problem is: As you can see, I don't know how I can put a zero left on numbers to have this visual representation: 02:00 - 01:59 - 01:58 - ... - 01:09 - n.
In programming languages, for example, we can format the outputed string like: print "Missiles: %02" % numberOfMissiles and obtain a plain text like: "Missiles: 003".
From now on, the question is obvious: "How can I do this with Construct 2?", how can I format my string? Or... if anyone has a better way to do this...
Thanks in advance.