Graphics

 View Only
  • 1.  DATALINQ AND SCRIPT

    Posted 05-25-2015 17:35

    It's possible use this script

    dim number as xpTextObject

    scene.getObjectByName("Text1", number)

    if cInt(text) >= "0" then

    number.textwithtags = "{font_green}" & number.textwithtags

    else

    number.textwithtags = "{font_red}" & number.textwithtags

    end if



    with datalinq in place of "0", for the auto change color



  • 2.  RE: DATALINQ AND SCRIPT

    Posted 05-25-2015 17:41
    Yes you can use datalinq, but the script is not correct. The script should be on the OnSetText event for the text object which is datalinqed, and the script should be like this:

    `

    if cInt(text) >= 0 then

    text = "{font_green}" & text

    else

    text = "{font_red}" & text

    end if

    `

    #XPression


  • 3.  RE: DATALINQ AND SCRIPT

    Posted 05-25-2015 20:00
    But this valor "0" is datalinqed too. I use in the races, and the value always changes, not is a exact value. He is also in datalinq.

    #XPression


  • 4.  RE: DATALINQ AND SCRIPT

    Posted 05-25-2015 20:05
    Does the datalinq need to update live while the page is on-air? Or, is it ok if it just updates once when putting the page on-air?

    #XPression


  • 5.  RE: DATALINQ AND SCRIPT

    Posted 05-25-2015 20:10
    In Live.
    ..........
    #XPression


  • 6.  RE: DATALINQ AND SCRIPT

    Posted 05-25-2015 20:11


  • 7.  RE: DATALINQ AND SCRIPT

    Posted 05-25-2015 20:11


  • 8.  RE: DATALINQ AND SCRIPT

    Posted 05-25-2015 20:24

    Ok, that's more complicated because either value could change independently of the other so you need scripts on both objects to update each other when they change.

    The script would be something like this:



    `

    dim compareText as xpTextObject

    scene.GetObjectByName("compareText", compareText)

    if cInt(text) >= CInt(compareText.Text) then

    text = "{font_green}" & text

    else

    text = "{font_red}" & text

    end if

    `

    Then you will need a text object called "compareText" that you datalinq to the value (the zero value).

    That text object will also need an OnSetText script that updates the other values when it is changing.

    That script would be something like this:

    `

    dim valueText as xpTextObject

    scene.GetObjectByName("valueText", valueText)

    if cInt(valueText.Text) >= CInt(text) then

    valueText.TextWithTags = "{font_green}" & valueText.Text

    else

    valueText.TextWithTags = "{font_red}" & valueText.Text

    end if

    `



    It would be much easier if it didn't need to live update, then it would just be a single script in the OnOnline that read the value of the "Zero" datalinq value and used it to set the red or green fonts..


    #XPression


  • 9.  RE: DATALINQ AND SCRIPT

    Posted 05-25-2015 20:30
    Usually live scoring graphics like that are driven with custom applications communicating with XPression's .NET interface. I'm not sure if you are a programmer or not, but if you are you might want to look at the C# interface for future projects as it can open up a huge set of possibilities.

    #XPression