Skip to content

Commit

Permalink
fix: Particle z-index inherited from ParticleEmitter
Browse files Browse the repository at this point in the history
  • Loading branch information
eonarheim committed Mar 4, 2024
1 parent 737baab commit e3de537
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions src/engine/Particles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -264,6 +265,7 @@ export enum ParticleTransform {
export interface ParticleEmitterArgs {
x?: number;
y?: number;
z?: number;
pos?: Vector;
width?: number;
height?: number;
Expand Down Expand Up @@ -465,6 +467,7 @@ export class ParticleEmitter extends Actor {
const {
x,
y,
z,
pos,
isEmitting,
minVel,
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit e3de537

Please sign in to comment.