Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better documentation on how to migrate to v5. #163

Open
hood opened this issue Aug 28, 2021 · 5 comments
Open

Better documentation on how to migrate to v5. #163

hood opened this issue Aug 28, 2021 · 5 comments

Comments

@hood
Copy link

hood commented Aug 28, 2021

As the titles says. Cannot import AnimatedParticle anymore after removing pixi-particles v4.3.1 and installing @pixi/particle-emitter v5.0.1 to replace it. I can see that it has been deprecated in v5 by looking at this commit: 11b21f8, but I'd like to get some documentation on how to use animated particles under this new version.
I've encountered other issues while following the examples, like PIXI.Texture.fromImage causing the following error to be thrown: Property 'fromImage' does not exist on type 'typeof Texture'.
Using the upgradeConfig helper is not helping in any way, since I'm getting Uncaught TypeError: Cannot read property 'time' of null errors at runtime whenever I try to spawn a particle.

@hood hood changed the title Module '"@pixi/particle-emitter"' has no exported member 'AnimatedParticle' after migrating to v5 Better documentation on how to migrate to v5. Aug 29, 2021
@andrewstart
Copy link
Contributor

Whoops, the Texture.fromImage() should have been Texture.from().
If you are seeing errors about a time property, then one of your behaviors that will end up with a PropertyList (color, alpha, speed, or scale) is misconfigured. I would have to see your config to know why.

@hood
Copy link
Author

hood commented Aug 29, 2021

After quite some time spent adapting code to this new version, I've managed to avoid the runtime errors I was talking about. Now the problem is that particles aren't getting emitted at all. If you want/can help me, I can invite you to my project's repo (it's private), otherwise I can paste some excerpts of code here, but there's a lot of custom boilerplate stuff going on, so I should paste quite big chunks of text in order to give you some valuable context.

@andrewstart
Copy link
Contributor

You can invite me, and I'll take a look this evening.

@hood
Copy link
Author

hood commented Aug 29, 2021

Done. You can use the pixi-particles-v5 branch to check the problematic code. It's mostly contained inside of the ParticlesManager class.

@andrewstart
Copy link
Contributor

For your circle spawn behaviors, r has been changed to radius. Additionally, ScaleBehavior was the only behavior using a minMult property that wasn't correctly catching undefined values, so you'll want to update to version 5.0.2 (which also fixes a bug with SingleAnimatedTextureBehavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants