Time counter

4

Index

Stats

12,985 visits, 25,250 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 7 Dec, 2011. Last updated 19 Feb, 2019

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!

  • 0 Comments

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