Jump to content
Search Community

Anim Feature Request – Yoyo with Always-Forward Ease Direction

Gary test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

The yoyo attribute (and method) makes it simple to repeat something back and forth many times.  Naturally, the ease is played in reverse every other leg.  I’d love to be able to optionally disable that and have it play the ease forward regardless of the yoyo direction.

 

This can be done in JS by duplicating and tweaking what yoyo does internally, but it's very nice having the convenience method.

 

Yoyo is a Boolean.  Perhaps it could take a string to trigger this.

{ yoyo: “easeForward” }
Link to comment
Share on other sites

Hi Gary  :)

 

for now pls try something like this :

 

var Tween = TweenMax.to("#redBox",1,{x:600,ease:Back.easeOut,onRepeat:repeat,repeat:-1,yoyo:true});

function repeat(){
  if(this.time()>0.1){ this.updateTo({ease:Back.easeIn}) }else{ this.updateTo({ease:Back.easeOut}) }
};

See the Pen RWRbxg by MAW (@MAW) on CodePen

 

i don't know your senario but btw you can use .tweenTo() / .tweenFromTo() + new ease type 

or tween your tween/tl progress by a simple tween + new ease type . 

  • Like 4
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...