How to use pixi-particles - 3 common examples

To help you get started, we’ve selected a few pixi-particles examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github daud-io / daud / Game.Engine / wwwroot / src / models / renderedObject.ts View on Github external
const emitterLayers: Emitter[] = [];
            for (let i = 0; i < layers.length; i++) {
                let emitterLayer: Emitter | null = null;
                const textureName = layers[i];

                if (this.activeEmitters[textureName]) emitterLayer = this.activeEmitters[textureName];
                else {
                    const textureDefinition = RenderedObject.getTextureDefinition(textureName);

                    if (textureDefinition.emitter) {
                        const particleTextureName = textureDefinition.particle;
                        const particleTextures = RenderedObject.loadTexture(RenderedObject.getTextureDefinition(particleTextureName), particleTextureName);

                        if (typeof textureDefinition.emitter == "string") textureDefinition.emitter = emitters[textureDefinition.emitter];

                        emitterLayer = new Emitter(this.container.emitterContainer, particleTextures, textureDefinition.emitter);
                        emitterLayer.emit = true;
                        emitterLayer.renderedObject = this;

                        emitterLayer.particleConstructor = GroupParticle;
                    }
                }

                if (emitterLayer != null) {
                    if (zIndex == 0) zIndex = 250;

                    // emitterLayer.zIndex = 1000 + i - zIndex - this.body.ID / 100000;

                    emitterLayers.push(emitterLayer);
                    this.activeEmitters[textureName] = emitterLayer;
                }
            }
github halftheopposite / tosios / packages / client / src / managers / GameManager.ts View on Github external
private spawnImpact = (x: number, y: number, color = '#ffffff') => {
    new Emitter(
      this.playersManager,
      [ParticleTextures.particleTexture],
      {
        ...particleConfig,
        color: {
          start: color,
          end: color,
        },
        pos: {
          x,
          y,
        },
      },
    ).playOnceAndDestroy();
  }
github avgjs / avg-core / src / components / particle / ParticleContainer.js View on Github external
constructor() {
    super(15000, {
      scale: true,
      position: true,
      rotation: true,
      uvs: true,
      alpha: true
    }, 15000);

    this.emitter = new particles.Emitter(this);

    this.lastTime = Date.now();
  }

pixi-particles

Particle emitter for Pixi.js

MIT
Latest version published 3 years ago

Package Health Score

54 / 100
Full package analysis

Popular pixi-particles functions