How do I create a timer that has minutes, and seconds?

  • I'm using timer behavior but it doesn't go to minutes. Anyway to do this? It stays in second and goes on to 61, 62 etc. I have a text ccalled timer and trying to use it

  • You can use this formula for your time format:

    TimeFormat = floor(Timer/60 % 60) & ":" & floor(Timer % 60)

  • You can use this formula for your time format:

    TimeFormat = floor(Timer/60 % 60) & ":" & floor(Timer % 60)

    So would I put tthis in the text? like

    On Function Set Question

    Set Timer text to:floor(Timer/60 % 60) & ":" & floor(Timer % 60)

    ?

  • Yes, it is correct.

    But you need to bring it out side the function if you want to display it every second.

  • Yes, it is correct.

    Thank you. Do you know how to start the timer cause thi is just the format.

  • You can use this formula for your time format:

    TimeFormat = floor(Timer/60 % 60) & ":" & floor(Timer % 60)

    So this is what

    I've done.

    On function setQuestion

    Start Timer(behaviour) "Q" for 0.0

    Set Text to: floor(Timer/60 % 60) & ":" & floor(Timer % 60)&(Timer.Timer.CurrentTime("Q"))

    On function checkQuestion

    Stop Timer.

    When the layout starts the setQuestion function begins, and when you press submit the checkquestion function begins. But right now My text "timer" get stuck at 0:00

  • > You can use this formula for your time format:

    > TimeFormat = floor(Timer/60 % 60) & ":" & floor(Timer % 60)

    So this is what

    I've done.

    On function setQuestion

    Start Timer(behaviour) "Q" for 0.0

    Set Text to: floor(Timer/60 % 60) & ":" & floor(Timer % 60)&(Timer.Timer.CurrentTime("Q"))

    On function checkQuestion

    Stop Timer.

    When the layout starts the setQuestion function begins, and when you press submit the checkquestion function begins. But right now My text "timer" get stuck at 0:00

    Okay I tried fizxing and didnt work. I'm using timer behaviour but it doesnt go to mminutes. Anyway to do this blackhornet?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • http://www.blackhornettechnologies.com/Construct3Stuff/Samples/TimerDisplay_applern.zip

    Thanks!. I tried doing

    On touch pausebutton pause timer.

    and on function checkQuestion Stop Timer.

    It didn't pause or stop and the text went back to seconds (i.e 5, 10, 20) and didn't pause or stop.

  • > > You can use this formula for your time format:

    > > TimeFormat = floor(Timer/60 % 60) & ":" & floor(Timer % 60)

    >

    > So this is what

    > I've done.

    >

    > On function setQuestion

    > Start Timer(behaviour) "Q" for 0.0

    > Set Text to: floor(Timer/60 % 60) & ":" & floor(Timer % 60)&(Timer.Timer.CurrentTime("Q"))

    >

    > On function checkQuestion

    > Stop Timer.

    > When the layout starts the setQuestion function begins, and when you press submit the checkquestion function begins. But right now My text "timer" get stuck at 0:00

    Okay I tried fizxing and didnt work. I'm using timer behaviour but it doesnt go to mminutes. Anyway to do this blackhornet?

    Nevermind. It did. Thank you so much for your help!. Have a wonderful day!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)