pixi-ease
pixi-ease copied to clipboard
each loop event with repeat
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)?
The easing emits the repeat event. I think that's what you're looking for:
generic.on('repeat', () => doSomething())
Thanks for the reply.
The easing emits the
repeatevent. 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' })