Jump to content
Search Community

not able to tween an object in bezier path

biplap 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

Hi, I am not able to tween an object in bezier path. More precisely, this statement is not working for me, neither am i getting any error in the console :-

           TweenMax.to(croppedimg, 5, {
                    bezier:[{x:100, y:250}, {x:300, y:0}, {x:500, y:400}],
                    onUpdate: function(){
                        layer.batchDraw();
            }});
 
Attaching the html and javascript code also

 

bezier.html

Link to comment
Share on other sites

There are a few options:

 

KineticJS uses setX, setY for positioning, and you can define this in the bezier points

TweenMax.to(croppedimg, 5, {
  bezier:[{setX:100, setY:250}, {setX:300, setY:0}, {setX:500, setY:400}],
  onUpdate: function(){
    layer.batchDraw();
    croppedimg.moveToTop();
    console.log(layer);
  }
});

or you could make use of GSAP's KineticPlugin. Carl made a great post about this today.

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