diff --git a/CHANGELOG.md b/CHANGELOG.md index 40cb041b3..9117a1f4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Fixed +- Fixed issue where `ex.ParticleEmitter` z-index did not propagate to particles - Fixed incongruent behavior as small scales when setting `transform.scale = v` and `transform.scale.setTo(x, y)` - Fixed `ex.coroutine` TypeScript type to include yielding `undefined` - Fixed issue where Firefox on Linux would throw an error when using custom Materials due to unused attributes caused by glsl compiler optimization. diff --git a/src/engine/Particles.ts b/src/engine/Particles.ts index e0974607f..75c9d4c55 100644 --- a/src/engine/Particles.ts +++ b/src/engine/Particles.ts @@ -134,6 +134,7 @@ export class ParticleImpl extends Entity { this.transform.pos = this.position; this.transform.rotation = this.currentRotation; this.transform.scale = vec(1, 1); // TODO wut + this.transform.z = this.emitter.z; if (this.particleSprite) { this.graphics.opacity = this.opacity; this.graphics.use(this.particleSprite); @@ -264,6 +265,7 @@ export enum ParticleTransform { export interface ParticleEmitterArgs { x?: number; y?: number; + z?: number; pos?: Vector; width?: number; height?: number; @@ -465,6 +467,7 @@ export class ParticleEmitter extends Actor { const { x, y, + z, pos, isEmitting, minVel, @@ -494,6 +497,7 @@ export class ParticleEmitter extends Actor { } = { ...config }; this.pos = pos ?? vec(x ?? 0, y ?? 0); + this.z = z ?? 0; this.isEmitting = isEmitting ?? this.isEmitting; this.minVel = minVel ?? this.minVel; this.maxVel = maxVel ?? this.maxVel;