Graphics

 View Only
  • 1.  Set Timer Widget via Text Radio Buttons

    Posted 07-26-2017 20:05
    During time outs we play various games with fans that are timed. These times are in varying lengths, :24, :30, :60 and so on. Due to an animation we are doing I need to be able to set these clocks using a text radio button. Can the timer widget start value be set using scripting from the text value of this radio button selection? Thx


  • 2.  RE: Set Timer Widget via Text Radio Buttons

    Posted 07-27-2017 06:53
    We have a scene that uses a countdown clock and pulls the time from a hidden text object. Perhaps your radio buttons could update the hidden text object. I have some comments in there that might help.


    I have this script in onOnline


    dim Clock as xpBaseWidget
    Engine.GetWidgetByName("Clock",Clock)

    dim CountdownFrom as xpBaseObject
    Self.GetObjectByName("CountdownFrom",CountdownFrom)

    ' CountdownFrom.Text comes in 00:00 format
    ' Split this into array and set offset of the widget

    dim time as string()
    time = split(CountdownFrom.Text,":")
    Clock.StartAt = "00:" + time(0) + ":" + time(1) + ".0"

    ' Clock widget must be string in this format: "00:02:00.0"


    Regards,
    Mike
    #XPression


  • 3.  RE: Set Timer Widget via Text Radio Buttons

    Posted 07-27-2017 16:19
    Are you placing this script in the root of the scene or on a text object? So far, no success.
    #XPression


  • 4.  RE: Set Timer Widget via Text Radio Buttons

    Posted 07-27-2017 17:09
    Mike, thanks I got it working. I had to fiddle with the offset. However this screws up my visual logic which basically turns a digital count into an analog sweep hand. Nice piece of work though. I will keep working on it.
    #XPression