Text Animation Direction
« on: September 10, 2015, 09:33:35 PM »
I have two tweens.

One animates text in and another animates the text out.

I am trying to go with the top effect:

However, there is no option for tween direction? It will always animate the same direction: from the left.

How is this example done?

Thanks!

*

Daniele

  • Dr. Admin, I presume
  • *****
  • 378
    • View Profile
    • Demigiant
Re: Text Animation Direction
« Reply #1 on: September 10, 2015, 11:44:08 PM »
Hi,

I am not sure what you mean with "animate from left". If you mean you'd want the tween to start from the filled string and "clear" it, you can just pass a value of "" to the end value.

About that example, you can find a similar one in the examples package.

Cheers,
Daniele

Re: Text Animation Direction
« Reply #2 on: September 11, 2015, 05:07:33 AM »
The examples in the package don't help :(

What I mean is this:

Print Hello starting from the left to the right.

->
H e l l o

Now take away each letter backwards;

hello
hell
hel
he
h
(nothing)

Just like the first tween in that gif.

Thanks!

*

Daniele

  • Dr. Admin, I presume
  • *****
  • 378
    • View Profile
    • Demigiant
Re: Text Animation Direction
« Reply #3 on: September 11, 2015, 11:48:43 AM »
That GIF simply uses a Yoyo loop, so that the tween plays forward and then backwards automatically:
Code: [Select]
myText.DOText("Final message to display", 2).SetLoops(-1, LoopType.Yoyo);
Otherwise, you could actually control it, like this:
Code: [Select]
// Set autokill to false so the tween is reusable
myTween = myText.DOText("Final message to display", 2).SetLoops(-1, LoopType.Yoyo).SetAutoKill(false);
// ... somewhere else in your code ...
// Plays the animation forward
myTween.PlayForward();
// Plays the animation backwards, cancelling the letters
myTween.PlayBackwards();