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

importing PathParticle #35

Closed
edap opened this issue Nov 5, 2016 · 5 comments
Closed

importing PathParticle #35

edap opened this issue Nov 5, 2016 · 5 comments

Comments

@edap
Copy link

edap commented Nov 5, 2016

I'm building a pixi videogame using es6 and babel. I've used this boilerplate https://github.com/magnonellie/pixi-boilerplate and I've added pixi-particles as dependency.
I'm importing pixi and pixi-particles as following:

import * as PIXI from "pixi.js";
import * as PIXIParticles from "pixi-particles";

I've no problem using PIXI.Container or PIXI.Particles.Emitter. But PIXI.particles.PathParticle results to be undifined. How should be included? is it not part of the PIXI.particles namespace

@andrewstart
Copy link
Contributor

andrewstart commented Nov 5, 2016

PathParticle is part of an optional submodule, to make the main library lighter for people that don't need it.
After importing pixi-particles, do require('pixi-particles/dist/modules/path-particle');, which should make PIXI.particles.PathParticle available.

@edap
Copy link
Author

edap commented Nov 5, 2016

What if I do not want to use the CommonJS syntax (using require) but i want to stick to es6 Syntax?

@edap
Copy link
Author

edap commented Nov 5, 2016

Also using the CommonJS syntax is not working:

import * as PIXI from "pixi.js";
require("pixi-particles/dist/modules/path-particle");

path-particle.js:63Uncaught TypeError: Cannot read property 'prototype' of undefined(…)

This happens around line 63
var s = Particle.prototype;
where Particle is not defined.

@andrewstart
Copy link
Contributor

I've published version 2.0.0 which has everything in one output file.

@edap
Copy link
Author

edap commented Nov 5, 2016

thank you ;)

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