Jump to content
Search Community

tween along a user defined path

Dece test
Moderator Tag

Recommended Posts

Hi,

 

I am first time user of TweenLite library. Must admit, this is awesome. The getting started guide was quite helpful.

 

here is something I am struggling with. Any help will be highly appreciated..

I want to use tweening of objects along a path. The path will be created at run-time by the user.

 

Basically the user can scribble a path (need not necessarily be a straight line) and I would like to tween an object on that path.

 

How do I go about doing this? I saw the bezier path tweeneing example mentioned in the getting started guide, but that wouldn't really help as I would not

know what path I will tween until the user draws one.

 

Once again thanks for help

Dece

Link to comment
Share on other sites

Sure, TweenLite can tween along a path. There is already built-in support for beziers and if you want to do straight lines, you'd just have to tween the x/y properties of your object to the various anchor points. You can easily sequence them with TimelineLite or TimelineMax. So if you're having your user draw curved lines with beziers, use the bezier plugin. If you're doing straight lines you don't have to do anything special except do a tween to each anchor point, and append() them in a TimelineLite one after the other. If you haven't seen the video at http://www.greensock.com/timeline-basics/, I'd recommend checking it out.

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