How to use other generators?
34r7h opened this issue · 4 comments
Hi again, sorry to be annoying. I can't see in the source code how to use another generator, like polygonPathGenerator. I put the same options for some hex animation from a tsparticle codepen, but instead of hex's it's making straight line out from the middle
You need to call the function described here: https://github.com/matteobruni/tsparticles/tree/main/paths/polygon#readme
You can call that function in the particlesInit
function, after the loadFull
or any similar load
that you have there.
Thanks, I called it in particlesInit, passing the same engine. Works lovely. Cheers brother!
const particlesInit = async (engine: Engine) => {
await loadFull(engine);
loadPolygonPath(engine);
};
Thanks, I called it in particlesInit, passing the same engine. Works lovely. Cheers brother!
const particlesInit = async (engine: Engine) => { await loadFull(engine); loadPolygonPath(engine); };
It's better to place an await in front of loadPolygonPath
too, It's something that will be fixed in the v3 documentation
cool thanks for the best practice!