Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatina Tween delay #50

Closed
indikaUih opened this issue Oct 1, 2019 · 1 comment
Closed

Fatina Tween delay #50

indikaUih opened this issue Oct 1, 2019 · 1 comment
Assignees
Labels

Comments

@indikaUih
Copy link

Is there a delay option available with the tween so that the tween can start after a certain delay like most tween libraries?
If it's not available can you please provide an update with the 'delay( )'?

@kefniark
Copy link
Owner

kefniark commented Oct 2, 2019

even if you closed it, I prefer to answer if someone else look for the answer later. 😄

Yes there is not .delay() on Tween, it's on Sequence.

If you don't want to use the sequence API, you can one line it:

tween.toSequence().prependInterval(duration);

And like that you can use:

  • .prependInterval(duration: number)
  • .appendInterval(duration: number)

or the full version with the Sequence API:

Fatina.sequence()
    .appendCallback(() => console.log("before delay"))
    .appendInterval(100)
    .appendCallback(() => console.log("after delay"))
    .append(tween)
    .appendCallback(() => console.log("tween finished, wait another delay"))
    .appendInterval(100)
    .appendCallback(() => console.log("sequence finished !"))
    .start();

Demo: https://runkit.com/embed/kibbtx7z0nl6

Related to: #38

@kefniark kefniark self-assigned this Oct 2, 2019
@kefniark kefniark pinned this issue Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants