Jump to content
Search Community

fromTo sets from value inside timeline

KoolieTheKangaroo test
Moderator Tag

Recommended Posts

Hi

 

I am doing a score interface in a PIXI application with an icon and a "x/y" text  (x found of y total - eg. 2/10)

 

I want to animate the icon (scale and rotate) and then update the x (x/y text is static in the pen) while animating it (scale):


 

gsap.timeline({repeat: -1, repeatDelay: 2})
            
            .fromTo(icon, {pixi:{rotation: 0}}, {pixi:{rotation: 1440, duration: 5}, ease: "back.out"}, "start")
            .fromTo(icon, {pixi:{scaleX: 1.4, scaleY: 1.4}}, {pixi: {scaleX: 1, scaleY: 1, ease: "bounce.out"}, duration: 1}, "start")          
            .fromTo(tf, {pixi:{scaleX: 1.4, scaleY: 1.4}}, {pixi: {scaleX: 1, scaleY: 1, ease: "bounce.out"}, duration: 1}, "start+=5")

 

What actually happens is that the text starts scaled up (from Value) and then animates to scale 1 when the time hits start+=5 hits. I would expect the fromValue to set in at the fromTo tween's start time.

 

I guess I misunderstand something basic about timelines here :)

Screenshot 2020-08-13 at 17.58.32.png

See the Pen KKzVZLx?editors=0011 by kooliekangaroo (@kooliekangaroo) on CodePen

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...