Graphics

 View Only
  • 1.  Animating between two text values

    Posted 12-18-2014 23:34
    Hello,

    I'm wondering if anyone has any suggestions on how to achieve this: I have a number that is controlled with a counter widget (It's a score graphic) What I'd like to do is when the number is changed, there would be a little animation where the number would "flip" to the next value. I think I have the logic figured out, but I'm terrible at this coding stuff.

    I've got the animation controller set up, and a secondary text object called "Text 2". In the animation controller, we see "text 2" first, and then it flips to the new value. Here's what I think needs to happen:

    On SetText (text object connected to widget):

    Set "Text 2" to (self - 1)

    play animation controller "flip"

    Am I on the right track with this logic? What is the code to set the text value of another text object? Is this the best way to achieve what I've Described?

    Any help is appreciated, thanks!


  • 2.  RE: Animating between two text values

    Posted 12-18-2014 23:56
    Search for the thread "scoreboard update animation".. I posted a sample a while ago..

    #XPression


  • 3.  RE: Animating between two text values

    Posted 12-19-2014 20:25
    Thanks Brian,

    I was able to find your project,and it helped a lot. I just have one modification I was hoping you could help me with.

    How do I make it so if there is another scene online in the sequencer (say Take ID#002 for example) it would play a different animation controller?

    dim score1B as xpTextObject

    dim acLong as xpAnimController

    dim acShort as xpAnimController

    dim ex as xpTakeItem

    scene.GetObjectByName("Score1B", score1B)

    scene.GetAnimControllerByName("ScoreChange1", acShort)

    scene.GetAnimControllerByName("ScoreChange2", acLong)

    engine.Sequencer.GetTakeItemByID(002, ex) // ???

    score1B.text = self.text

    if ex.online = true then

    acLong.PlayRange(0, 100)

    else

    acShort.PlayRange(0, 10)

    end if



    This code doesn't work but I hope you can see the logic of what I'm trying to accomplish: Basically there is a little "Goal" animation that can play on another layer when a goal is scored, so I'd like to delay the number flip until the end of that animation. But if they are just changing numbers, I don't want any delay. Hope that makes sense..

    Thanks again

    #XPression


  • 4.  RE: Animating between two text values

    Posted 12-19-2014 21:43
    Your code looks good except for the `if ex.online` part..

    Try `if ex.IsOnline` instead..

    #XPression


  • 5.  RE: Animating between two text values

    Posted 12-21-2014 22:03
    duh....

    Thanks Brian!

    #XPression