Git Product home page Git Product logo

Comments (4)

andrewstart avatar andrewstart commented on June 1, 2024

Just as a sanity check, could you try version 5.0.5 and see what happens? Also, are you using the autoUpdate property, or are you calling Emitter.update() on your own?

from particle-emitter.

codingchili avatar codingchili commented on June 1, 2024

ah many thanks, I'm not sure why the particle system was playing 50x slower yesterday.. today it's playing way too fast instead.

anyways, I'm not using the PIXI.ticker.shared - calling emitter.update(deltaSec) from my RAF loop. I see that autoUpdate defaults to false, which should be fine for me. BUT when I check the property at runtime autoUpdate was set to true.

I'm using the playOnceAndDestroy method, I'm not sure why it sets autoUpdate to true? this seems to override any autoUpdate property set in the config and the default value of false,

playOnceAndDestroy(callback) {
            this.autoUpdate = true;
            this.emit = true;
            this._destroyWhenComplete = true;
            this._completeCallback = callback;
        }

And the reason (at least for particle systems playing too fast) was that autoUpdate modifies my delta in the update method,

if (this._autoUpdate) {
    delta = ticker.elapsedMS * 0.001;
}

Particles are looking great and working as expected again when I set autoUpdate to false after calling playOnceAndDestroy. :)

from particle-emitter.

andrewstart avatar andrewstart commented on June 1, 2024

Yeah, playOnceAndDestroy() is intended to be used with autoUpdate as the simple way of doing things. Outside of that, you can start an emitter with emitter.emit = true or emitter.playOnce(), call emitter.update() yourself and then destroy or reuse the emitter when it is complete.

from particle-emitter.

codingchili avatar codingchili commented on June 1, 2024

Thanks, it's all in the docs too :)

from particle-emitter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.