Time counter

Index

Stats

8,522 visits, 17,717 views

Translations

This tutorial hasn't been translated.

Tools

3.

After I have set the local variables, I want to put the results into the Text variable.

- If the hour value is below 10, I will add a 0 before the hour value.

This because I personally think it looks nicer if it says "08" instead of "8". This check is not needed and can be deleted/disabled if wished.

Next step, I add the actual hour value to the TotalTime Text, and a ":" as a simple seperator, making it easier to see the result.

- Same as with hours, I check if the minutes value is below 10, I will add a 0 before the hour value. This because I personally think it looks nicer if it says "08" instead of "8". This check is not needed and can be deleted/disabled if wished.

Next step, I add the actual minutes value to the TotalTime Text, and a ":" as a simple seperator, making it easier to see the result.

- Same as with hours and minutes, I check if the seconds value is below 10, I will add a 0 before the hour value. This because I personally think it looks nicer if it says "08" instead of "8". This check is not needed and can be deleted/disabled if wished.

Next step, I add the actual minutes value to the TotalTime Text, and here I do not add a seperator, since the seconds is the last value I want to add to the TotalTime Text.

- The last step, is to add the TotalTime variable to a textfield in the Layout. In the example I have here, Text is a simple Text object created inside Construct 2.

And that is all there is to it!

Have you gotten this far, you notice that nothing is displayed on the screen. And to see how to make that possible, we go to the next and final part of this tutorial!

  • 1 Comments

  • Order by
Want to leave a comment? Login or Register an account!