# Animated spritesheet as the particle texture - ParticleEmitter

**URL:** <https://phaser.discourse.group/t/animated-spritesheet-as-the-particle-texture-particleemitter/13868>\
**Category:** Phaser 3\
**Created:** [January 9, 2024, 9:55pm UTC](https://phaser.discourse.group/t/animated-spritesheet-as-the-particle-texture-particleemitter/13868 "2024-01-09T21:55:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rangerz132](https://avatars.discourse-cdn.com/v4/letter/r/cc9497/32.png) [@Rangerz132](https://phaser.discourse.group/u/Rangerz132)\
**Post date:** [January 9, 2024, 9:55pm UTC](https://phaser.discourse.group/t/animated-spritesheet-as-the-particle-texture-particleemitter/13868/1 "2024-01-09T21:55:17Z")

</div>

Hello! I’m facing some issues regarding the ParticleEmitter.

I’m currently able to create a particule emitter with a specific texture. However, I would like to change the texture frame of the particles based on a spritesheet animation.

I can use my spritesheet as the current texture for the particles but the particle texture is not animated according to my spritesheet animation. How can I achieve that? I can’t find any example for this specific issue.

Thanks!

Here’s a pseudo code:

```javascript
 var config = {
      speed: { min: this.minSpeed * assetsDPR, max: this.maxSpeed * assetsDPR },
      lifespan: { min: this.minLifeSpan, max: this.maxLifeSpan },
      scale: { start: this.minScale * assetsDPR, end: this.maxScale * assetsDPR },
      blendMode: this.blendMode,
      duration: this.duration,
      quantity: this.quantity
    }

var tempTexture = this.scene.textures.get(this.texture)
var isSpriteSheet = tempTexture && tempTexture.hasOwnProperty('frameTotal')

if (isSpriteSheet) {
  // TODO : animate the particles according to the spriteSheet texture

  // Test
  // config['frames] = ...
}

// Create ParticleEmitter
this.itemObject = this.scene.add.particles(this.x, this.y, this.texture, config)

```

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [January 10, 2024, 9:06pm UTC](https://phaser.discourse.group/t/animated-spritesheet-as-the-particle-texture-particleemitter/13868/2 "2024-01-10T21:06:03Z")

</div>

```js
const emitter = this.add.particles(400, 300, 'gems', {
    anim: 'prism'
    // etc.
});

```

- [Animated Particles](https://github.com/phaserjs/phaser/blob/master/changelog/3.60/ParticleEmitter.md#animated-particles)

---

<div class="post-metadata">

**Author:** ![Rangerz132](https://avatars.discourse-cdn.com/v4/letter/r/cc9497/32.png) [@Rangerz132](https://phaser.discourse.group/u/Rangerz132)\
**Post date:** [January 11, 2024, 3:52pm UTC](https://phaser.discourse.group/t/animated-spritesheet-as-the-particle-texture-particleemitter/13868/3 "2024-01-11T15:52:26Z")

</div>

Wow! It’s a good thing that I’m using the 3.6v!

Thanks!
