Graphics

 View Only
  • 1.  Getting rid of leading zero script

    Posted 12-19-2018 18:26
    I'm doing a 2 min countdown timer. Widget is set to N:SS. Can anyone send a script to get rid of leading zero once it gets down to :59?


  • 2.  RE: Getting rid of leading zero script

    Posted 12-19-2018 18:44
    Hi !

    Try to say, "Hello" and "please", maybe I (or someone) could help you.
    #XPression


  • 3.  RE: Getting rid of leading zero script

    Posted 12-19-2018 19:09
    Hi. Please and thank you.
    #XPression


  • 4.  RE: Getting rid of leading zero script

    Posted 12-19-2018 21:19
    Here is the code to put in OnRender of your scene :
    Dim MyTimer as xpClockTimerWidget = nothing
    Engine.GetWidgetByName("ClockTimer1", MyTimer)

    If MyTimer.TimerValue < 60000 then
    MyTimer.Format = ":SS"
    Else
    MyTimer.Format = "N:SS"
    End If


    Have a nice day...
    #XPression


  • 5.  RE: Getting rid of leading zero script

    Posted 12-20-2018 21:03
    Peas and carrots!
    #XPression


  • 6.  RE: Getting rid of leading zero script

    Posted 12-21-2018 18:42
    Thanks for the code, Vinz. I must be doing something wrong as I am not getting it to work.

    In scene I clicked edit script, "OnRender" tab, plugged in code and hit compile.

    Am I missing something?
    #XPression


  • 7.  RE: Getting rid of leading zero script

    Posted 12-21-2018 20:57
    Did you change the name of your widget in my code ?
    Replace ClockTimer1 by the name of your timer widget.
    #XPression


  • 8.  RE: Getting rid of leading zero script

    Posted 01-02-2019 17:09
    Hi,

    Yes, I did replace the widget name. Is the code only supposed to be on the OnRender tab? Thx
    #XPression


  • 9.  RE: Getting rid of leading zero script

    Posted 01-02-2019 17:39
    Hey Vinz and hbel:

    Thanks for this! I ended up using your script for my NYE show and it worked flawlessly :-)

    hbel: It worked for me with the script in the OnRender tab only.

    Cheers!

    CJ
    #XPression


  • 10.  RE: Getting rid of leading zero script

    Posted 01-02-2019 17:52
    gfxjones: Glad it worked for you! What the hell am I doing wrong? LOL. I tried un/checking everything except OnRender and also have the script only in that tab and still see the leading zero.
    #XPression


  • 11.  RE: Getting rid of leading zero script

    Posted 01-02-2019 18:55
    hbel, can you share a dropbox or google link to your scene and we could look to see what you are doing?
    #XPression