Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Gary

Anim Feature Request – Yoyo with Always-Forward Ease Direction

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

Isn't that just an easeInOut?

 

EDIT: Eh... Maybe not after thinking about it.

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

Clever!  I think I can get it to work with this approach.  Thanks.

 

(still might be a nice feature to have a variation of yoyo to simplify it)

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.
×