pixijs / particle-emitter

A particle system for PixiJS
http://pixijs.io/particle-emitter/docs
MIT License
784 stars 124 forks source link

Query: Best way to resize spawnShape? #172

Closed aMadReason closed 2 years ago

aMadReason commented 2 years ago

Hi,

Sorry to bother you, I've been looking through the repository trying to determine how I can change the emitter's spawn shape behaviour after instantiation.

I'm using the rain animation in front of a backdrop, but the rest of my pixie setup resizes on window resize and responds to the size of the containing element, the emitter does not and though I can see methods to update position I can't see one to update behaviours like the spawn shape.

Animation isn't generally my area so very probably I'm missing something obvious; if someone can assist or point in in the right direction I'd appreciate it.

Thanks!

andrewstart commented 2 years ago
const b = myEmitter.getBehavior('spawnShape');
b.shape.w = window.innerWidth;// or whatever you are using to control size

I am doing the same thing in https://github.com/andrewstart/Thunderstorm/blob/main/dist/index.js

aMadReason commented 2 years ago

@andrewstart You sir are a gentleman and a scholar and I appreciate the fact you exist. :) Thank you!! You solved all my problems.