@goldenratio/karlib
    Preparing search index...

    Class ParticleEmitter

    Particle Emitter Implementation is based on pixi-particles https://github.com/pixijs-userland/particle-emitter

    Implements

    • Disposable
    Index

    Constructors

    Methods

    • If particles should be emitted during update() calls. Setting this to false stops new particles from being created, but allows existing ones to die out.

      Parameters

      • value: boolean

      Returns void

    • Callback is invoked when emitter animation completes. This is supported only when emitter has valid lifetime, If lifetime is -1, callback won't be invoked.

      Parameters

      • fn: () => void

      Returns void

    • Update loop

      Parameters

      • delta_time: number

        Scalar representing the delta time factor (value between 0 to 1)

      Returns void

    • Changes the spawn position of the emitter. Changing spawn position will restart the emitter

      Parameters

      • x: number

        The new x value of the spawn position for the emitter.

      • y: number

        The new y value of the spawn position for the emitter.

      Returns void

    • Sets the rotation of the emitter to a new value. This rotates the spawn position in addition to particle direction.

      Parameters

      • new_rotate_degrees: number

      Returns void