Graphics

 View Only
  • 1.  Sports highlight winner?

    Posted 08-15-2013 19:34
    I'm building a scoreboard, and I have 2 quads that sits behind my text layers, one for each line. I am wanting the quads to be visible only for the winning team. My 5 text layers are Top Team, Bottom Team, Top Score, Bottom Score and Game Status. Does anyone know how to script it to say if game status is final, compare top score and bottom score, and change visibility to true for the line with the higher score? Thanks!


  • 2.  RE: Sports highlight winner?

    Posted 08-16-2013 14:09
    Hi Aaron,

    Take a look at this sample. Edit the values from the sequencer to observe the automation behavior.

    The script is in OnOnline and OnPreviewRender (the same script should be in both places, otherwise you won't see the effects when you generate a preview).

    https://na11.springcm.com/atlas/Link/Document/12442/3c6e5928-7d06-e311-a16d-d89d67143433/ddc45534-7d06-e311-a16d-d89d67143433

    #XPression


  • 3.  RE: Sports highlight winner?

    Posted 08-23-2013 20:59
    I unfortunately don't have time to check the link Brian provided, but we have this setup at WREX. Basically, I determined what we would use to denote a game as being "final," and we settled on "F." This is important to do, because in the script I'm about to provide, if something is listed as being in the "fourth" instead of the "4th," it can cause it to misbehave.

    So if "F" is entered, the game is over. Here's the script:

    dim Toptext as xpTextObject

    dim Bottomtext as xpTextObject

    dim Topinteger as Integer

    dim Bottominteger as Integer

    dim status as xpTextObject

    dim Topwinner as xpBaseObject

    dim Bottomwinner as xpBaseObject

    Self.GetObjectByName("Top Score", Toptext)

    Self.GetObjectByName(Bottom Score", Bottomtext)

    Topinteger=Cint(Toptext.Text)

    Bototminteger=Cint(Bototmtext.Text)

    Self.GetObjectByName("Game Status", status)

    Self.GetObjectByName("Top Winner Quad", Topwinner)

    Self.GetObjectByName("Bottom Winner Quad", Bottomwinner)

    if InStr(status.Text, "F") = 1 and Topinteger > Bottominteger then

    Topwinner.Visible = True

    Bottomwinner.Visible = False

    elseif InStr(status.Text, "F") = 1 and Bottominteger > Topinteger then

    Bottomwinner.Visible = True

    Topwinner.Visible = False

    else

    Topwinner.Visible = False

    Bottomwinner.Visible = False

    end if


    That was done rough and off the top of my head, so take it with a grain of salt, but the idea is in there.

    #XPression