Jump to content
Robert May

Jump To Labels

Recommended Posts

Hi all. Is there a tutorial on how to use labels so that I can test my animations without having to wait for the whole animation to get to the part I'm testing?  I think I remember Carl talking about it in one of his videos but I cannot find it. Thanks!

Share this post


Link to post
Share on other sites

Hi @Robert May :)

 

Welcome to the forum and thank you for joining Club GreenSock. 

 

When I'm testing I like to add a 'start test' and 'end test' label. I also add a couple buttons so I can play that test area forwards or backwards via tweenFromTo().

 

See the Pen EKZjpo by PointC (@PointC) on CodePen

Here's some more info about tweenFromTo()

https://greensock.com/docs/#/HTML5/GSAP/TimelineMax/tweenFromTo/

 

Hopefully that helps.

 

Happy tweening and welcome aboard.

:)

  • Like 1

Share this post


Link to post
Share on other sites

Thanks for your response, I've been playing with the code pen for a while. When I added ".add(pause)" to your code pen it would no longer tween from start to end or end to start, should that be a problem and if so, is there another way to pause the timeline without interfering with tweening the timeline? 

Share this post


Link to post
Share on other sites
4 hours ago, Robert May said:

Thanks for your response, I've been playing with the code pen for a while. When I added ".add(pause)" to your code pen it would no longer tween from start to end or end to start, should that be a problem and if so, is there another way to pause the timeline without interfering with tweening the timeline? 

Hi,

 

You can easily pause a timeline by using .addPause()

https://greensock.com/docs/#/HTML5/GSAP/TimelineMax/addPause/

 

To jump to next label, use:

var nextLabel = getLabelAfter()
tl.tweenTo(nextLabel)
 
 

See the Pen aWExEE by vikrant-icd (@vikrant-icd) on CodePen

 
 

 

  • Like 3

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.