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

each loop event with repeat #25

Open
lumenier1 opened this issue Dec 11, 2021 · 2 comments
Open

each loop event with repeat #25

lumenier1 opened this issue Dec 11, 2021 · 2 comments

Comments

@lumenier1
Copy link

import * as PIXI from 'pixi.js'
import { Ease, ease } from 'pixi-ease'

const app = new PIXI.Application()
const test = app.stage.addChild(new PIXI.Sprite(PIXI.Texture.WHITE))
const generic = ease.add(test, { alpha: 0 }, { duration: 1500, repeat: true, ease: 'easeOutQuad' })
generic.on('each', () => console.log(test.generic))

Docs are saying that: fires on each loop when there are eases running

But it fires on each tick (every frame).

So, how to catch an event when the current loop of repetitive animation is completed (event between each repetitive loop)?

@lumenier1 lumenier1 changed the title each event bug each loop event with repeat Dec 11, 2021
@davidfig
Copy link
Owner

The easing emits the repeat event. I think that's what you're looking for:

generic.on('repeat', () => doSomething())

@lumenier1
Copy link
Author

Thanks for the reply.

The easing emits the repeat event. I think that's what you're looking for:

generic.on('repeat', () => doSomething())

Unfortunately, this doesn't work.

Also it would be great to add new parameter repeatDelay for the add() method like so:

ease.add(test, { alpha: 0 }, { duration: 1500, repeat: true, repeatDelay: 500, ease: 'easeOutQuad' })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants