pixijs / particle-emitter

A particle system for PixiJS
http://pixijs.io/particle-emitter/docs
MIT License
786 stars 124 forks source link

More of a question #121

Closed dr3adx closed 4 years ago

dr3adx commented 4 years ago

Hello,

I'm using pixi particles to make ability that looks like shield around player in my game. I only render players that are near me, not all of them. So my question is when new player enters my viewport and supposedly he had pixi particle (shield) running on him for 2 seconds before he entered my viewport and only now my client renders the particle emitter, is there a way to SKIP pixi particle 2 seconds in? As to show that specific duration has passed. I was thinking of solutions to this, but even if I know that player had shield on him for 2 seconds i cant just reduce the duration of emitter by 2 secs because the animation will start from beginning (e.g lets take that megaman death example, i dont want to see circles going from very begining from inside to outside but rather show animation 2 seconds in when circles are all in outer layer) To summarize, is it possible to skip-forward particles "X" amount of seconds in?

Thanks in advance.

andrewstart commented 4 years ago

call yourEmitter.advance(2) to run the emitter for 2 seconds immediately.

dr3adx commented 4 years ago

call yourEmitter.advance(2) to run the emitter for 2 seconds immediately.

holy shiet you're da MVP bro!!!!!

dr3adx commented 4 years ago

@andrewstart Hello, I tried advance but it seems like there's no such function emitter.advance is not a function

andrewstart commented 4 years ago

Yep, I should have checked the code instead of assuming that I remembered correctly - the method name is update, not advance.