Paddy Posted March 5, 2020 Share Posted March 5, 2020 I hope this is a fairly simply question I'm moving an item like this gsap.fromTo("#graphMaskHandle", 60, {x:-155}, {x:0}); It seems to start moving more quickly then slow down as it goes on. Is there some kind of easing on as default for gsap? If so, how do I turn it off and get linear motion? If not, any ideas what's going on? (I'm forbidden from sharing my code on CodePen, unfortunately) I'm using it to reveal a graph over a 60 second period, so the graph needs to be revealed to match up with "seconds" on the x axis. I'm a newbie to green sock; I'm finding it brilliantly useful, but, on top of my poor maths, I'm having a bad day with this. Any help would be appreciated. Link to comment Share on other sites More sharing options...
OSUblake Posted March 5, 2020 Share Posted March 5, 2020 9 minutes ago, Paddy said: Is there some kind of easing on as default for gsap? Yep. It uses power1.out, which works well as a default for most animations. https://greensock.com/docs/v3/Eases 10 minutes ago, Paddy said: If so, how do I turn it off and get linear motion? You can turn it off globally. gsap.defaults({ ease: "none" }); Or on a per animation basis. gsap.fromTo("#graphMaskHandle", 60, {x:-155}, {x:0, ease: "none" }); 4 1 Link to comment Share on other sites More sharing options...
Carl Posted March 5, 2020 Share Posted March 5, 2020 Yup. GSAP animations have a default ease of "power1" https://greensock.com/docs/v3/Eases You can change easing on a per-tween basis like gsap.fromTo("something", {x:10}, {y:200, ease:"none"}) or globally https://greensock.com/docs/v3/GSAP/gsap.defaults() gsap.defaults({ease:"none"}); or on a timeline gsap.timeline({defaults:{ease:"none"})); 4 1 Link to comment Share on other sites More sharing options...
Paddy Posted March 5, 2020 Author Share Posted March 5, 2020 Superb! Thanks - I'd just found out some of that, but I hadn't found the default option - that'll be really useful. 2 Link to comment Share on other sites More sharing options...
Carl Posted March 5, 2020 Share Posted March 5, 2020 looks like i'm 30 seconds slower than @OSUblake today but i'd like an extra point for the timeline example. 🤣 1 4 Link to comment Share on other sites More sharing options...
Paddy Posted March 5, 2020 Author Share Posted March 5, 2020 Definitely an extra point for the timeline, Carl. Thanks. 1 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now