[Plugin] TR_ClockParser

0 favourites
  • 10 posts
From the Asset Store
I18N - Translation plugin
$7.20 USD
10% off
The I18N (Translation) is a Construct plugin created to translate text in game.
  • Timer is a common feature especially in casual games. I use it a lot as well so I decided to make a plugin to make timer display more comfortable.

    TR_ClockParser simply converts number of seconds to clock-string. There are few expressions to use.

    Download:

    [C2 plugin]

    Plugin icon by totoe - thanks!

    TR_ClockParser.Minimal(seconds) - Return the smallest possible clock string.

    Examples:

    TR_ClockParser.Minimal(30) -> "30"

    TR_ClockParser.Minimal(90) -> "01:30",

    TR_ClockParser.Minimal(4830) -> "01:20:30"

    TR_ClockParser.MMSS(seconds) - Return the "MM:SS" clock string.

    Examples:

    TR_ClockParser.MMSS(30) -> "00:30"

    TR_ClockParser.MMSS(90) -> "01:30"

    TR_ClockParser.MMSS(4830) -> "80:30"

    TR_ClockParser.HHMMSS(seconds) - Return the "HH:MM:SS" clock string.

    Examples:

    TR_ClockParser.HHMMSS(30) -> "00:00:30"

    TR_ClockParser.HHMMSS(90) -> "00:01:30"

    TR_ClockParser.HHMMSS(4830) -> "01:20:30"

    TR_ClockParser.ToSeconds(timeString) - Converts the specified clock string to seconds.

    Examples:

    TR_ClockParser.ToSeconds("01:03:30" ) -> 3810

    TR_ClockParser.ToSeconds("15:30") -> 930

    TR_ClockParser.ToSeconds("30") -> 30

  • Milliseconds to hours, minutes, seconds is quite annoying to set up.

    Thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Handy, Thanks!

  • So useful. Thanks...

  • I've just uploaded version 1.1. The previous version was expecting a string as a param for expressions. It worked well with numeric variables but could bring problems with various other attempts like using other expression (that returns int) as a param.

    Even though it's a super small fix I couldn't get it working (backward compatible) by setting the old expressions as deprecated for some reason so I had to make it as non-fully-backward compatible (still the link to the old version is available).

    If you used this plugin in your project and provided a string as a parameter for expression, then you will have to remove that line from C2, update the plugin, restart C2 and add it again.

    If you haven't used a string earlier then you can simply update the plugin. Sorry for this issue, I just missed this detail somehow.

  • TR_ClockParser is now available for C3 as well. Updated links in the first post here.

  • Updated to version 1.2, added "ToString" expression.

    TR_ClockParser.ToSeconds(timeString) - Converts the specified clock string to seconds.

    Examples:

    TR_ClockParser.ToSeconds("01:03:30" ) -> 3810

    TR_ClockParser.ToSeconds("15:30") -> 930

    TR_ClockParser.ToSeconds("30") -> 30

  • Thanks for this useful plugin.

  • Could you please update c3 version to work with c3runtime :)

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